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 playHand(opponent, score, beats, losesTo, draws) {
const opponents = {
[beats]: () => score.player1++,
[losesTo]: () => score.player2++,
[draws]: () => {}
};
opponents[opponent].call();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment