Particle's 8-Queens!
  home | services | products | resources | forum
 
about us | contact   
Particle
December 2nd, 2024



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
SQLRunner
Graphics Tutorials
Hacking Tutorials
Java Applets
MIDI Music
Gov & Misc Docs

Games
Chess Game
Asteroids
Tic-Tac-Toe
Tetris

Applets
DRAW!
FlightBox
pWobble 3D
pRunner
NYU HWs
Swarms
Geometry
Chaos
Machine Learning

Academic
CISC 7700X
CISC 7512X
CISC 7500X
IT Mngmt (old)
SW (old)
Networks (old)
OS (old)
AI (old)
App Dev (old)
C++ (old)
OOP (old)
Web (old)
Perl (old)
DBMS (old)
ProgLangs (old)
PHP (old)
MltMedia (old)
Oracle (old)

Misc
Privacy Policy
Publications
profphreak.com



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-2024 by End of the World Production, LLC.