Basics-Beat-That-Submission: Ying Ling#575
Open
yinglingtan wants to merge 11 commits intorocketacademy:mainfrom
Open
Basics-Beat-That-Submission: Ying Ling#575yinglingtan wants to merge 11 commits intorocketacademy:mainfrom
yinglingtan wants to merge 11 commits intorocketacademy:mainfrom
Conversation
floatingtales
left a comment
There was a problem hiding this comment.
Great attempt at beat that, Ying Ling! Can't wait to see what you can do for blackjack!
| while (counter < 2) { | ||
| currentPlayerRolls.push(rollDice()); | ||
| counter = counter + 1; | ||
| } |
There was a problem hiding this comment.
in this instance it might be better to use a for loop as opposed to a while loop. You already know how many times the loop will run!
| var GAME_STATE_DICE_ROLL = "GAME_STATE_DICE_ROLL"; | ||
| var GAME_STATE_CHOOSE_DICE_ORDER = "GAME_STATE_CHOOSE_DICE_ORDER"; | ||
| var GAME_STATE_COMPARE_SCORES = "GAME_STATE_COMPARE_SCORES"; | ||
| var gameState = GAME_STATE_DICE_ROLL; |
|
|
||
| // Helper Function | ||
| var rollDice = function () { | ||
| console.log("Control flow: start of rollDice()"); |
There was a problem hiding this comment.
console logs usually are internal checks for your use only, it usually is omitted for final code submissions.
| // tie | ||
| if (allPlayersScore[0] == allPlayersScore[1]) { | ||
| compareMessage = compareMessage + "<br><br>It's a tie!"; | ||
| } |
There was a problem hiding this comment.
slight nitpick here, it might be better to use:
if(...){
// logic
} else if(...){
// logic
} else {
// logic
}
if/else if/else is better than consecutive ifs here.
Author
|
Cool! thanks for the feedback @floatingtales |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Please fill out the survey before submitting the pull request. Thanks!
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
How many hours did you spend on this assignment?
Please fill in one error and/or error message you received while working on this assignment.
What part of the assignment did you spend the most time on?
Comfort Level (1-5): 2 (because of the walk through's help)
Completeness Level (1-5): 5
What did you think of this deliverable? (I couldn't have done it w/o the walk through)
Is there anything in this code that you feel pleased about? (I finished the walk through, even though I got lost a few times throughout).
What's one aspect of your code you would like specific, elaborate feedback on? Nothing. But I wish the basics could be recap again.