title: Organizing array of unknown number of constants in all possible ways
body: <p>What is the best way of looping through an array, ending up organizing it in all possible ways it can be organized in?</p>
  
  <p>Suppose we have an array:</p>
  
  <pre><code>{a, b, c, d}
  </code></pre>
  
  <p>What I would like to do with this is organize it like so:</p>
  
  <pre><code>{b, a, c, d}
  {b, d, c, a}
  </code></pre>
  
  <p>And so forth, looping around creating one array to analyze per looping.</p>
  
  <p>Thank you,</p>