-
Notifications
You must be signed in to change notification settings - Fork 380
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
Robby DeRouin Mod 1 Prework #204
base: master
Are you sure you want to change the base?
Robby DeRouin Mod 1 Prework #204
Conversation
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.
Nice effort here! I highly recommend keeping up progress on the last challenges- the pseudocode and research that goes into that is great preparation for project work at Turing.
removeTopping(topping) { | ||
for (var i = 0; i < this.toppings.length; i++){ | ||
if (this.toppings[i]==topping){ | ||
this.toppings.splice(i,1); |
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.
Nice job iterating through your toppings to find one that matches the topping to remove!
} | ||
} | ||
} | ||
|
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.
Nice work setting this up in a function that can be run for any number of frogs! Don't forget the special circumstance for when i = 2: the language is slightly different there!
Also, I suggest putting special cases in the if/elseif block... I would put the 'default' condition in the last else block. Right now, it seems like the most hit condition is in the first block.
@@ -0,0 +1,10 @@ | |||
function checkerBoard (checkers){ | |||
for (var i = 1; i <= checkers; i++) { | |||
if (i % 2 === 0){ |
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.
You may need a loop within your loop if you want the ability to change the length of your rows.
Here is my Mod 1 Prework