Created
August 31, 2016 15:27
-
-
Save anonymous/0f536ae4fdbe0a2671bff1ca410e3907 to your computer and use it in GitHub Desktop.
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
if ( game.user === game.computer ) { | |
game.winner = 'tie'; | |
} else { | |
var wins = {'rock':'scissor','scissor':'paper','paper':'rock'}; | |
var game.winner = (wins[game.user] === game.computer) ? 'user' : 'computer'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment