Skip to content

rock-paper-scissors homework submission#5

Open
hamzakoc wants to merge 2 commits into
hackyourfuturecanada:Hamza-Kocfrom
hamzakoc:master
Open

rock-paper-scissors homework submission#5
hamzakoc wants to merge 2 commits into
hackyourfuturecanada:Hamza-Kocfrom
hamzakoc:master

Conversation

@hamzakoc
Copy link
Copy Markdown

@hamzakoc hamzakoc commented Sep 5, 2019

No description provided.

@epq
Copy link
Copy Markdown
Collaborator

epq commented Sep 12, 2019

@farnous Please leave some feedback for Hamza!

Comment thread game.js Outdated



function game (){
Copy link
Copy Markdown

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

Comment thread game.js Outdated

function playRound(playerSelection,computerSelection){

if( playerSelection !== "rock" && playerSelection !== "paper" && playerSelection !== "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.

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