Stella Basics 11-10#339
Open
Stellaellaella wants to merge 3 commits into
Open
Conversation
EricFooSD
reviewed
Oct 22, 2021
EricFooSD
left a comment
There was a problem hiding this comment.
Overall very nice job Stella! Thanks for the work!
Comment on lines
+1
to
+4
| // input user enters scissors, paper or stone | ||
| // output random scissors, paper or stone | ||
| // computer will use math.random to determine scissors, paper or stone | ||
| // rules: scissors beats paper, peper beats stone, ston beats scissors. if both parties choose the same object, it's a draw. | ||
| // rules: scissors beats paper, peper beats stone, ston beats scissors. if both parties choose the same object, it's a draw. |
Comment on lines
7
to
11
| var rollDice = function () { | ||
|
|
||
| var randomFloat = Math.random() * 3; | ||
| var resultInteger = Math.floor(randomFloat + 1); | ||
| return resultInteger; | ||
| }; |
There was a problem hiding this comment.
[Suggestion] Could you have added to this code to immediately generate the computer's roll?
Comment on lines
+16
to
+20
| var userWon = 0; | ||
| var computerWon = 0; | ||
| var drawNum = 0; | ||
| var roundPlayed = userWon + computerWon + drawNum; | ||
| var playerWinPercentage = 0; |
There was a problem hiding this comment.
[Comment] Setting of global variables. Good job
Comment on lines
+34
to
+37
| if (currentGameMode == "waiting for user name") { | ||
| userName = input; | ||
| currentGameMode = "game mode"; | ||
| myOutputValue = `Hello ${userName} <br><br> Type scissors ✂️ or paper 🗒 or stone 🗿 to play. <br><br> Rules: <br>scissors ✂️ beats paper 🗒, <br> paper 🗒 beats stone 🗿, <br> and stone 🗿 beats scissors ✂️. <br><br> If both parties choose the same object, it is a draw.`; |
There was a problem hiding this comment.
[Comment] Very nice setting of the user name here
Comment on lines
+83
to
+86
| if ( | ||
| (playerAction == scissors && randomAction == paper) || | ||
| (playerAction == paper && randomAction == stone) || | ||
| (playerAction == stone && randomAction == scissors) |
There was a problem hiding this comment.
[Comment] Good job combining the IF conditions with || such that you can immediately find the winning condition
| (playerAction == paper && randomAction == stone) || | ||
| (playerAction == stone && randomAction == scissors) | ||
| ) { | ||
| userWon = userWon + 1; |
There was a problem hiding this comment.
[Suggestion] Here you can simplify with userWon += 1
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? 3hours
Please fill in one error and/or error message you received while working on this assignment.
syntax error
What part of the assignment did you spend the most time on?
Comfort Level (1-5): 3
Completeness Level (1-5): 3
What did you think of this deliverable?
Is there anything in this code that you feel pleased about?