Generating chess pieces

On a standard 8x8 chess board, I'm trying to generate all the possible placement of 8 pieces so that no two pieces are on the same row or same column. Diagonals are ok, just rows and columns.

I know it's possible to do it randomly, but I can't think of an algorithm to generate every combination systematically. Right now I'm thinking along the lines of something like:

int[] piece =newint [7];

I let the index value of piece to be the row number, and let the actual value of piece to be the column number. Any help on this would be greatly appreciated.

[683 byte] By [P@PE.SOWa] at [2007-10-2 17:44:46]
# 1
Oh and btw, printing the combinations is not required.
P@PE.SOWa at 2007-7-13 19:02:30 > top of Java-index,Java Essentials,Java Programming...
# 2
This qustions was posted and answered recently! Seach for the 8 queens problem.
sabre150a at 2007-7-13 19:02:30 > top of Java-index,Java Essentials,Java Programming...
# 3
> Oh and btw, printing the combinations is not required.Good thing too, because there are 178,462,987,637,760 different ways to do that. That also means that, although an algorithm for generating those ways is extremely simple, looking for that algorithm is not a good idea.
DrClapa at 2007-7-13 19:02:30 > top of Java-index,Java Essentials,Java Programming...