forked from turingschool-examples/frontend-mod-1-prework
-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jerry Vohrer #212
Open
Jerry-Vrrr
wants to merge
42
commits into
turingschool:main
Choose a base branch
from
Jerry-Vrrr:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+762
−200
Open
Jerry Vohrer #212
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
2514ce2
Update concatenation.js
Jerry-Vrrr 10d1102
Add Section 1
Jerry-Vrrr fb70589
modify concatenation.js
Jerry-Vrrr 0ab2a84
Add section2 exercises
Jerry-Vrrr 2f72b0c
Add section2 reflections
Jerry-Vrrr a76e95e
modify reflections
Jerry-Vrrr 2c84c05
modify reflections
Jerry-Vrrr 6b1a114
Update reflection.md
Jerry-Vrrr 7114d11
Update reflection.md
Jerry-Vrrr cf18be8
Update reflection.md
Jerry-Vrrr 09895a7
Update reflection.md
Jerry-Vrrr 52b789b
Update reflection.md
Jerry-Vrrr c5fd751
Update reflection.md
Jerry-Vrrr 1eec842
Update reflection.md
Jerry-Vrrr 7406636
Initial commit
Jerry-Vrrr 2ed4e8d
Add array methods
Jerry-Vrrr 884974f
Add exercises
Jerry-Vrrr 3e4efd7
Add reflections
Jerry-Vrrr 4d6f739
Merge branch 'main' of github.com:Jerry-Vrrr/frontend-mod-1-prework
Jerry-Vrrr 55ecd12
Update reflection.md
Jerry-Vrrr 4e18a30
Update reflection.md
Jerry-Vrrr 9fdf9a6
Update reflection.md
Jerry-Vrrr 370ba04
Update reflection.md
Jerry-Vrrr da18fc7
Update reflection.md
Jerry-Vrrr ba15f78
Initial commit.
Jerry-Vrrr 1bfde24
Modify reflection
Jerry-Vrrr 8142050
Update README.md
Jerry-Vrrr 0da664c
Update README.md
Jerry-Vrrr 8c00676
Update README.md
Jerry-Vrrr 27d7d2d
Initial commit
Jerry-Vrrr 20dca43
Merge branch 'main' of github.com:Jerry-Vrrr/frontend-mod-1-prework
Jerry-Vrrr 251bf0b
Add annotations.js
Jerry-Vrrr 94d8154
Refactor section1
Jerry-Vrrr 6367707
Refactor Section2
Jerry-Vrrr c8c46bd
Refactor section3
Jerry-Vrrr 709fce9
Refactor section4
Jerry-Vrrr cd29ef2
Update README.md
Jerry-Vrrr 19e1b69
Update README.md
Jerry-Vrrr dce325d
Create README.md
Jerry-Vrrr 1751d8c
Update README.md
Jerry-Vrrr e79a4e7
Update README.md
Jerry-Vrrr f2f0def
Add corrections to modZeroHero.js
Jerry-Vrrr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,93 @@ | ||
// Challenge - See if you can follow the instructions and complete the exercise in under 30 minutes! | ||
|
||
// Declare two variables - heroName AND specialAbility - set to strings | ||
var heroName = "Velvet Mummy"; | ||
var specialAbility = "dance fighting"; | ||
console.log(heroName); | ||
console.log(specialAbility); | ||
|
||
// Declare two variables - greeting AND catchphrase | ||
// greeting should be assigned to a string that uses concatenation to include the heroName | ||
// catchphrase should be assigned to a string that uses interpolation to include the specialAbility | ||
var greeting = "Coo coo cachoo," + heroName; | ||
console.log(greeting); | ||
|
||
var catchPhrase = `When crime is up, I get down and boogie with my ${specialAbility}!`; | ||
console.log(catchPhrase); | ||
|
||
// Declare two variables - power AND energy - set to integers | ||
var power = 9; | ||
var energy = 7; | ||
|
||
var fullPower = (power * 500); | ||
var fullEnergy = (energy + 150); | ||
console.log(fullPower); | ||
console.log(fullEnergy); | ||
|
||
// Declare two variables - fullPower AND fullEnergy | ||
// fullPower should multiply your current power by 500 | ||
// fullEnergy should add 150 to your current energy | ||
|
||
// Declare two variables - isHuman and identityConcealed - assigned to booleans | ||
|
||
var isHuman = true | ||
var identityConcealed = false | ||
|
||
// Declare two variables - archEnemies AND sidekicks | ||
// archEnemies should be an array of at least 3 different enemy strings | ||
// sidekicks should be an array of at least 3 different sidekick strings | ||
|
||
var archEnemies = ["Sand Demon", "Twist O Wallace", "Zoot Suit Swampdog"]; | ||
var sideKicks = ["Silk Sphinx", "The Scarab Kid", "Disco Dracula" ]; | ||
// Print the first sidekick to your console | ||
|
||
console.log(sideKicks[0]); | ||
// Print the last archEnemy to the console | ||
|
||
console.log(archEnemies[2]); | ||
// Write some code to add a new archEnemy to the archEnemies array | ||
|
||
archEnemies.push("The Unraveler"); | ||
// Print the archEnemies array to console to ensure you added a new archEnemy | ||
|
||
console.log(archEnemies); | ||
// Remove the first sidekick from the sidekicks array | ||
|
||
sideKicks.shift(); | ||
// Print the sidekicks array to console to ensure you added a new sidekick | ||
|
||
console.log(sideKicks); | ||
// Create a function called assessSituation that takes three arguments - dangerLevel, saveTheDay, badExcuse | ||
// - dangerLevel should be an integer | ||
// - saveTheDay should be a string a hero would say once they save the day | ||
// - saveTheDay should be a string a hero would say once they save the day | ||
// - badExcuse should be a string a hero would say if they are too afraid of the dangerLevel | ||
var announcement = 'Never fear, the Courageous Curly Bracket is here!'; | ||
var excuse = 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.'; | ||
|
||
function assessSituation(dangerLevel, saveTheDay, badExcuse) { | ||
// if ((dangerLevel >=10) && (dangerLevel< 50)) { | ||
// console.log(announcement) | ||
// } else if (dangerLevel < 10) { | ||
// console.log("Meh. Hard pass.") | ||
// } else if (dangerLevel > 50) { | ||
// console.log(excuse) | ||
// } | ||
if (dangerLevel > 50) { | ||
console.log(badExcuse) | ||
} else if (dangerLevel < 10) { | ||
console.log("Meh. Hard pass.") | ||
} else { | ||
console.log(saveTheDay) | ||
} | ||
|
||
}; | ||
|
||
//var dangerLevel = 99 | ||
assessSituation(99,"Saving the day!", "I need to wash my hair tonight." ) | ||
//var dangerLevel = 21 | ||
assessSituation(21, announcement, excuse) | ||
//var dangerLevel = 3 | ||
assessSituation(3, announcement, excuse) | ||
// Your function should include an if/else statement that meets the following criteria | ||
// - Danger levels that are above 50 are too scary for your hero. Any danger level that is above 50 should result in printing the badExcuse to the console | ||
// - Anything dangerLevel that is between 10 and 50 should result in printing the saveTheDay string to the console | ||
// - If the dangerLevel is below 10, it means it is not worth your time and should result in printing the string "Meh. Hard pass." to the console. | ||
|
||
//Test Cases | ||
var announcement = 'Never fear, the Courageous Curly Bracket is here!'; | ||
var excuse = 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.'; | ||
//var announcement = 'Never fear, the Courageous Curly Bracket is here!'; | ||
//var excuse = 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.'; | ||
// assessSituation(99, announcement, excuse) > Should print - 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.' | ||
//assessSituation(21, announcement, excuse) > should print - 'Never fear, the Courageous Curly Bracket is here!' | ||
//assessSituation(3, announcement, excuse) > should print - "Meh. Hard pass." | ||
|
@@ -55,30 +99,76 @@ var excuse = 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back. | |
// - citiesDestroyed (array) | ||
// - luckyNumbers (array) | ||
// - address (object with following key/values: number , street , state, zip) | ||
|
||
|
||
// Create a new class called SuperHero | ||
// - Your class should have the following DYNAMIC values | ||
// - name | ||
// - superpower | ||
// - age | ||
// - Your class should have the following STATIC values | ||
// - archNemesis, assigned to "The Syntax Error" | ||
// - powerLevel = 100 | ||
// - energyLevel = 50 | ||
|
||
var scaryMonster = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The syntax for this object looks good. |
||
name: "Bigfoot", | ||
Smell: "not good", | ||
weight: 952, | ||
citiesDestroyed: ["Olympia", "Portland"], | ||
luckyNumbers: [2,3,4], | ||
address: address = { | ||
number: 7, | ||
street: "Quatch Quarry lane", | ||
state: "Washington", | ||
zip: 12347, | ||
} | ||
} | ||
console.log(scaryMonster); | ||
Create a new class called SuperHero | ||
- Your class should have the following DYNAMIC values | ||
- name | ||
- superpower | ||
- age | ||
- Your class should have the following STATIC values | ||
- archNemesis, assigned to "The Syntax Error" | ||
- powerLevel = 100 | ||
- energyLevel = 50 | ||
class SuperHero { | ||
constructor(name, superpower, age,) { | ||
this.name = name | ||
this.superpower = superpower | ||
this.age = age | ||
this.archNemesis = "The Syntax Error" | ||
this.powerLevel = 100 | ||
this.energyLevel = 50 | ||
} | ||
|
||
|
||
|
||
sayName(){ | ||
console.log(this.name); | ||
} | ||
maximizeEnergy(){ | ||
console.log(this.energyLevel = 1000); | ||
} | ||
gainPower(number){ | ||
console.log(this.powerLevel += number); | ||
} | ||
} | ||
// - Create the following class methods | ||
// - sayName, should print the hero's name to the console | ||
|
||
|
||
// - maximizeEnergy, should update the energyLevel to 1000 | ||
// - gainPower, should take an argument of a number and INCREASE the powerLevel by that number | ||
|
||
//var maximizeEnergy = (energyLevel = 1000); | ||
//var gainPower = (energyLevel * 2) | ||
// console.log(maximizeEnergy); | ||
// console.log(gainPower); | ||
// - Create 2 instances of your SuperHero class | ||
|
||
|
||
var soop1 = new SuperHero("Crybaby", "literal heart melting tears", .5 ); | ||
soop1.sayName(); | ||
soop1.maximizeEnergy(); | ||
console.log(soop1); | ||
var soop2 = new SuperHero("The Swaddler", "Magic Blanket", 32); | ||
//console.log(soop); | ||
soop2.sayName(); | ||
soop2.gainPower(9); | ||
console.log(soop2); | ||
// Reflection | ||
// What parts were most difficult about this exerise? | ||
|
||
// Recalling newly acquired skills. I stumbed a bit on some of the commands. Took longer than expected. | ||
// What parts felt most comfortable to you? | ||
|
||
// Most of it felt great and went smoothly, but it was a needed reminder that things that were easy yesterday | ||
// could become dificult again if I don't keep sharp. | ||
// What skills do you need to continue to practice before starting Mod 1? | ||
|
||
//All of them, and almost daily. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you read the directions carefully. The variable
greeting
should use concatenation with theheroName
andcatchPhrase
should use interpolation with thespecialAbility
.