title: Programming Rock, Paper, Scissors choice combinations - Javascript
body: <p>Forgive me if a topic on this has already been created, but I've looked and can't seem to find it.</p>
  
  <p>I am trying to figure out how get an output of every single possible combination of rock paper scissors choices there are based on X amount games. </p>
  
  <p>The equation for how many possible results there are is simple - X^Y = Results. </p>
  
  <p>(X to the Yth power--where X equals the number of games and Y equals the number of choices--equals the number of possible combinations.)</p>
  
  <p>So lets say one person plays three games of rock, paper, scissors. That's <code>3^3 = 27</code>.</p>
  
  <p>If <code>rock = 1</code>, <code>scissors = 2</code>, and <code>paper = 3</code>, ( I listed them in this order so it can go from left to right on which beats which) then the results would be:
  111,
  112,
  113,
  121,
  122,
  123
  ... and so on...</p>
  
  <p>But the question is, how do I get this to output? 
  For 3^3, I could just do an outer loop, with 1 inner loop, then 1 inner loop for that one. 
  But I need it to be dynamic, so that I can pass in X for the number of games, and Y for the number of choices, and have it return an array of all the possible combinations of choices there are. So I'm thinking that I can have 1 loop for every column (where columns equal the number of games) .. I'm just not sure how I'd do this.</p>
  
  <p>I need the results to be in an array so I can look for certain combos later on.</p>
  
  <p>Can anyone help me out with this?</p>
  
  <p>All I really need is the logic, so pseudo-code would be fine. But a solid script would be great too.</p>
  
  <p>Thanks in advance!</p>