Skip to content

Instantly share code, notes, and snippets.

@jasongorman

jasongorman/game.js Secret

Created Apr 3, 2020
Embed
What would you like to do?
function play(game, player1, player2) {
let score = {...game.score};
let winner = undefined;
const hands = {
rock: () => playHand(player2, score, scissors, paper),
paper: () => playHand(player2, score, rock, scissors),
scissors: () => playHand(player2, score, paper, rock)
};
hands[player1].call();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment