Skip to content

Instantly share code, notes, and snippets.

@TravisJN
Created August 4, 2015 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save TravisJN/060b519a1148e3bad254 to your computer and use it in GitHub Desktop.
Save TravisJN/060b519a1148e3bad254 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