Particle's 8-Queens!
  home | services | products | resources | forum
 
about us | careers | contact   
Particle
February 5th, 2007



www.theparticle.com
Main
Services
Products
Resources
Forum
About Us
Contact

Particle Revelation
Hardware Destruction
Quotes
Humor [alpha]
Murphy's Laws

Programming
Java
Java Data Structures
C# Data Structures
Database Design
Graphics Tutorial
Artificial Intelligence

Downloads
Graphics Tutorials
Hacking Tutorials
Java Applets
MIDI Music
Gov & Misc Docs

Games
Chess Game
Asteroids
Tic-Tac-Toe
Tetris

Applets
DRAW!
pRunner
pWobble 3D
NYU HWs
Swarms (NEW)
Geometry (NEW)

Academic
CIS 704 (OS)
CIS 2.55 (Perl)
CIS 748 (LAN)
DB Sys (old)
DBMS (old)
Perl (old)
ProgLangs (old)
PHP (old)
MltMedia (old)
Oracle (old)
cis.kicks-ass.org

Misc
Prof.Phreak
Domains
Wallpapers
Good-Will Links
Privacy Policy
E-Mail Tutorial
G.E.C.C.T.T.
Publications

TheParticle Affiliates
profphreak.com
asdfcorp.com
wr0k.com
kos.kicks-ass.org
particle.homeip.net

Links
WuyaSea
alex_n's site
Monoxide IRC



Particle's 8-Queens!

Your browser does not support Java. (or has it disabled)

 

The 8-Queens Problem is a problem of placing eight queens on an 8x8 chess board so that no queen attacks another queen.

This algorithm goes through every combination and finds all possible solutions. There are 92 solutions for the 8x8 board of an 8-queens problem. The program will first go 'quickly' through all the solutions (delaying only about 2/1000 of a second between different combinations; hey, I want the search to actually be visible! If you can't wait, download the source, remove the Thread.sleep() calls out of find8queens() method, and recompile), Once it finds all the solutions, it will suspend the searching thread. The user at any time can stop or continue the searching thread. The user can also click on any of the solutions, and then on the 'view' button to view that solution in the 'view' area. Once all the solutions have been found, the program will sleep for 15/1000 of a second between possible combinations (so that you can actually see what's going on).

Problem: The applet seems to flicker quite a bit when running. I can't figure out why, or how to eliminate it. I have the update() and paint() methods overloaded, and still, it flickers. If you have a solution, please let me know.

There are many other solutions to this problem. Some do it row order, and not column order (as this one does).

NOTE: Unfortunately, this applet only works on newer browsers which support JDK 1.1, and will not work on browsers such as Netscape 3.0 (at least not on the UNIX version I've tested), however, it does work perfectly under Netscape 4.0 (again, UNIX version), and under Internet Explorer 4.

You can download this applet (and/or the source for it here) License Agreement is in the source file.

[queens.java][queens.class][queensCanvas.class]

























© 1996-2007 by End of the World Production, LLC.