Skip to content

SPS#14

Open
paul0955 wants to merge 1 commit intorocketacademy:mainfrom
paul0955:main
Open

SPS#14
paul0955 wants to merge 1 commit intorocketacademy:mainfrom
paul0955:main

Conversation

@paul0955
Copy link

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):

Completeness Level (1-5):

What did you think of this deliverable?

Is there anything in this code that you feel pleased about?

Copy link

@DominiqueYeo DominiqueYeo left a comment

Choose a reason for hiding this comment

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

Nice helper functions making the main code short and clean. Interesting way of determining the reversed game!

Comment on lines +1 to +8
// Counters to keep track of scores
var totalAttempts = 0;
var userWinCount = 0;
var computerWinCount = 0;
var drawCount = 0;
// Player's name
var userName = "";
var emptyUserName = true;

Choose a reason for hiding this comment

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

good commenting to explain the variables

var userInputForGame = userInput;
var userWon = true;
if (userInput.startsWith("Reversed")) {
userInputForGame = userInputForGame.replace("Reversed ", "");

Choose a reason for hiding this comment

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

nice use of string method to format your user input for the reversed game

Comment on lines +77 to +79
if (reversedGame == true) {
userWon = !userWon;
}

Choose a reason for hiding this comment

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

Interesting way of handling the reversed game logic!

Comment on lines +104 to +111
// if ("win" in battleResult) {
// userWinCount += 1;
// } else if ("lose" in battleResult) {
// computerWinCount += 1;
// } else {
// drawCount += 1;
// }

Choose a reason for hiding this comment

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

can remove unused code before sharing code for readability

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