"Johanes " <eyenir@gmail.com> wrote in message <kj8alp$fhe$1@newscl01ah.mathworks.com>...
> I know how to find every time one solution but I want to find all of the 92, so I thouhgt running the function 92 times. How can I prevent same solutions return (same does not mean symatrical to previous solution)?
> thanks.
> By the was, is this the right forum for publishing this problem ?
       
You can use recursion for this problem. Using a chessboard 8 x 8 matrix which is initially all zeros, at the first recursion level for the first queen start at the first position, and afterwards at successive positions, in the natural linear index ordering and then fill the matrix with ones at that position and all others attacked by this queen. Pass this matrix down to the next recursion level where again the second queen starts at the first unattacked position following the first queen and thereafter proceeds through successive unattacked positions. When it is placed, add ones wherever the second queen attacks and pass this matrix on to the third recursion level. This continues until either there are no available positions left or you succeed in placing the eight queen at the eight recursion depth. In this latter case you have found a solution. With this methodical approach you
will find all solutions without any duplications.
Note that if you wish to avoid recursive coding, you can accomplish the same thing using nested forloops eight deep.
Roger Stafford
