title: Algorithm to find out all the possible positions
body: <p>I need an algorithm to find out all the possible positions of a group of pieces in a chessboard. Like finding all the possible combinations of the positions of a number N of pieces.</p>
  
  <p>For example in a chessboard numbered like cartesian coordinate systems any piece would be in a position </p>
  
  <pre><code>(x,y) where 1 &lt;= x &lt;= 8 and 1 &lt;= y &lt;= 8
  </code></pre>
  
  <p>I'd like to get an algorithm which can calculate for example for 3 pieces all the possible positions of the pieces in the board. But I don't know how can I get them in any order. I can get all the possible positions of a single piece but I don't know how to mix them with more pieces.</p>
  
  <pre><code>for(int i = 0; i&lt;= 8; i++){
      for(int j = 0; j&lt;= 8; j++){
          System.out.println("Position: x:"+i+", y:"+j);
      }
  }
  </code></pre>
  
  <p>How can I get a good algoritm to find all the posible positions of the pieces in a chessboard?</p>
  
  <p>Thanks.</p>