Created
August 18, 2013 04:11
-
-
Save jamesflorentino/6259860 to your computer and use it in GitHub Desktop.
Bato bato pik
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function compare(choice1, choice2) { | |
if (choice1 === choice2) { | |
return 'Result is a tie'; | |
} else if (choice1 === 'rock') { | |
if (choice2 === 'scissors') { | |
return 'Rock wins'; | |
} else if (choice2 === 'paper') { | |
return 'Paper wins'; | |
} | |
} else if (choice1 === 'paper') { | |
if (choice2 === 'rock') { | |
return 'Paper wins'; | |
} else if (choice2 === 'scissors') { | |
return 'Scissor wins'; | |
} | |
} else if (choice1 === 'scissors') { | |
if (choice2 === 'rock') { | |
return 'Rock wins'; | |
} else if (choice2 === 'paper') { | |
return 'Scissor wins'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment