Skip to content

Instantly share code, notes, and snippets.

Created August 31, 2016 15:27
Show Gist options
  • Save anonymous/0f536ae4fdbe0a2671bff1ca410e3907 to your computer and use it in GitHub Desktop.
Save anonymous/0f536ae4fdbe0a2671bff1ca410e3907 to your computer and use it in GitHub Desktop.
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