The Eight Queens problem is pretty famous as far
as math puzzles go. To
solve the Eight Queens problem, one must place eight queens on a
standard 8x8 chessboard such that none of the queens have the ability
to take any other queen, using its' standard moves (up and down, side
to side, and diagonally). The problem has a pretty simple solution,
which is posted
It's written in Python, which to me has an unfamiliar syntax, but I
eventually understood the gist of what it did and wrote my own version
in Java. The source
code has extensive comments if you want to
try this yourself, and I made a standalone
app version as well. Enjoy! (nQueens - someday)
-Applet now works in OSX with Aqua!
-There are some refresh problems...
-License updated to GPLv3.
launching this page about a year ago, I have been flattered by the
amount of people
worldwide who have visited. To these I address a small disclaimer: this
applet clearly could have
been developed a lot more cleanly in many different ways (e.g. using a
1D array instead of 'QueenRecord')
but the focus here was on playing around with Swing and threads as much
as it was on creating
a functional version of EightQueens, which has been done many times
over. Keep this in mind
when trying to develop your own versions or looking through my code. -eli b.