> ABOUT ME >RESUME >LINKS I LIKE >MAIN PAGE>GUESTBOOK>PROGRAMS
Click here to see the Java code . The Applet is at the bottom of the page .
The Eight Queens Problem : Arranging 8 queens on a chessboard with 8x8 squares such that none of them are under
attack from each other .
There are 92 possible ways of arranging Eight Queens on an 8 x 8 ChessBoard such that none of them attacks another .
Actually , the number of unique ways in 12 ,but by reflection / rotation / inversion ,we get 92 possiblecases . A lot of the
solutions are mirror images of each other .
The Applet below , en-lists the 92 possible solutions in the List Box . As you may see , each solution has been
enlisted in the form of an Eight digit number . The solutions ( i . e . the Eight digit numbers ) contain the column
numbers , in respective order of the rows . For example , consider the first solution in the list ( 15863724 ) : --
This Eight digit number ( 15863724) is to be interpreted in the following way : --
The Queen in the FIRST row is to be placed in Column 1 . ( 1 is the FIRST digit from the left )
The Queen in the SECOND row is to be placed in Column 5 . ( 5 is the SECOND digit from the left )
The Queen in the THIRD row is to be placed in Column 8 . ( 8 is the THIRD digit from the left )
..... and so on .
NOTE : If you click on any of the solutions in the List Box , and then click 'View' , you will be able to see
the corresponding arrangement of Eight Queens on the ChessBoard . The top-most row is row number 1 ,
and the left-most column is column number 1 . ( Or you may just Double Click on a solution in the List Box
to see the corresponding arrangement of Eight Queens on the ChessBoard . ) The Queens will be marked
in RED .
> ABOUT ME >RESUME >LINKS I LIKE >MAIN PAGE>GUESTBOOK>PROGRAMS