Skip to content
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

hw 4, hopefully meets all requirements & bonuses #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sad3xoxo
Copy link

I already know it's super messy, but still looking forward to your feedback. :)

Copy link

@aghaffar570 aghaffar570 left a comment

Choose a reason for hiding this comment

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

@sad3xoxo Great job with the rock-scissor-paper game and implementing the additional features!! ✨ 💯 also, great use of breaking your code into functional parts.

Comment on lines +82 to +86
const n = winnerList.length - 1
// grab the last 3 winners from the winnerList
const one = winnerList[n]
const two = winnerList[n - 1]
const three = winnerList[n - 2]

Choose a reason for hiding this comment

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

@sad3xoxo interesting take on getting 3 consecutive wins. another approach could be to increment a consecutive win variable for human and computer and it resets to zero when the other player scores and does not reach 3 consecutive wins. it saves memory because the winnerList never reset and it stores items even after a final winner. In any case, great job adding the additional features to the game!!! 👍

Comment on lines +94 to +95
updateScore(winnerList[n])
updateScore(winnerList[n])

Choose a reason for hiding this comment

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

@sad3xoxo could have also passed a 1 or 2 depending on the conditional statement and whether to add bonus points. it still works!

}
}

function updateRoundScore (winner) {

Choose a reason for hiding this comment

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

@sad3xoxo the pageUpdate varibale is used quite often in this function and could be extended into a function that writes the new status with the respective winners passed as an argument. I read the comments, so great job anyway! 💯

check out the approach here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants