Skip to content

Conversation

@hamzakoc
Copy link

@hamzakoc hamzakoc commented Sep 5, 2019

No description provided.

@epq
Copy link
Collaborator

epq commented Sep 12, 2019

@farnous Please leave some feedback for Hamza!

game.js Outdated



function game (){
Copy link

Choose a reason for hiding this comment

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

the function work perfectly
but it does not show the final result of the 5 rounds ( I mean who won the most rounds )
you can save the rounds in an array and at the end of the game you can check who win.

and also you may not count the round if the result is ( tie ) because no one win

game.js Outdated

function playRound(playerSelection,computerSelection){

if( playerSelection !== "rock" && playerSelection !== "paper" && playerSelection !== "scissors" ){
Copy link

Choose a reason for hiding this comment

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

Hello Hamza
I think if you convert the playerSelection to lower case at the beginning of the function it will let the player to insert the choice as he/she want , for example : rock, Rock, ROCK.

Suggested change
if( playerSelection !== "rock" && playerSelection !== "paper" && playerSelection !== "scissors" ){
playerSelection = playerSelection..toLowerCase();
if( playerSelection !== "rock" && playerSelection !== "paper" && playerSelection !== "scissors" ){

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.

3 participants