Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@arminsebastian
Forked from TravisJN/rockPaperPermutation.js
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arminsebastian/9880bc3d0a60d3356f5b to your computer and use it in GitHub Desktop.
Save arminsebastian/9880bc3d0a60d3356f5b to your computer and use it in GitHub Desktop.
Rock Paper Permutation
/*
* Write a function that generates every sequence of throws a single
* player could throw over an n round game of rock-paper-scissors.
*
* For 3 rounds your output should look something like:
* [["r", "r", "r"],
* ["r", "r", "p"],
* ["r", "r", "s"],
* ["r", "p", "r"],
...etc...
]
*
* - Make your function return answers for any number of rounds.
* Example:
* rockPaperScissors(5); // => [['rock', 'rock', 'rock', 'rock', 'rock'], etc...]
*
*/
var rockPaperScissors = function (roundCount) {
// TODO: your solution here
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment