Skip to content

Stella Basics 11-10#339

Open
Stellaellaella wants to merge 3 commits into
rocketacademy:mainfrom
Stellaellaella:main
Open

Stella Basics 11-10#339
Stellaellaella wants to merge 3 commits into
rocketacademy:mainfrom
Stellaellaella:main

Conversation

@Stellaellaella

Copy link
Copy Markdown

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?

@EricFooSD EricFooSD left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall very nice job Stella! Thanks for the work!

Comment thread script.js Outdated
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Comment] Nice pseudo code here!

Comment thread script.js
Comment on lines 7 to 11
var rollDice = function () {

var randomFloat = Math.random() * 3;
var resultInteger = Math.floor(randomFloat + 1);
return resultInteger;
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] Could you have added to this code to immediately generate the computer's roll?

Comment thread script.js
Comment on lines +16 to +20
var userWon = 0;
var computerWon = 0;
var drawNum = 0;
var roundPlayed = userWon + computerWon + drawNum;
var playerWinPercentage = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Comment] Setting of global variables. Good job

Comment thread script.js
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.`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Comment] Very nice setting of the user name here

Comment thread script.js
Comment on lines +83 to +86
if (
(playerAction == scissors && randomAction == paper) ||
(playerAction == paper && randomAction == stone) ||
(playerAction == stone && randomAction == scissors)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Comment] Good job combining the IF conditions with || such that you can immediately find the winning condition

Comment thread script.js
(playerAction == paper && randomAction == stone) ||
(playerAction == stone && randomAction == scissors)
) {
userWon = userWon + 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] Here you can simplify with userWon += 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants