1. Home
  2. Computing & Technology
  3. Delphi Programming

Placing 8 Queen's on a ChessBoard
Fancy Delphi Application Contest Entry #2 by Mikael Eriksson

By Zarko Gajic, About.com

8 Queens on a ChessBoard - Fancy Delphi Application Contest Entry #2

8 Queens on a ChessBoard - Fancy Delphi Application Contest Entry #2

In chess, a queen can move as far as she pleases, horizontally, vertically, or diagonally. A chess board has 8 rows and 8 columns. The standard 8 by 8 Queen's problem asks how to place 8 queens on an ordinary (empty) chess board so that no queen is under attack by another.

Placing 8 queen's on a chessboard is a classic use of backtracking algorithm - a great problem for the FDAC - Fancy Delphi Application Contest.

Rate this FDAC Entry!

8 Queens

"8 Queens" is a Delphi application hosting a chess board to try for yourself and a button that will give you the possible solutions.

Start by double-clicking a cell in a grid. The program will display what cells are "taken" by this action - so that queens do not threaten each other on the next move. Continue placing your queens. You should put 8 of them.

If you fail, you can always go for the "Solve" button. This will display the list of possible solutions in a string list. Double click an item to be displayed in the grid.

"8 Queens" was submitted by "Mikael Eriksson".

Do you have a FDA(C)? Submit your Delphi code to the Fancy Delphi Application Contest.

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Source Code Projects
  5. 8 Queen's on a Chess Board - Fancy Delphi Application Contest Entry #2

©2009 About.com, a part of The New York Times Company.

All rights reserved.