Delphi Programming

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

Peg Solitare Solver - Delphi Source Included

Fancy Delphi Application Contest Entry #41 by Andreas Dumont

By Zarko Gajic, About.com

Peg Solitare Solver - Fancy Delphi Application Contest Entry #41

Peg Solitare Solver - Fancy Delphi Application Contest Entry #41

Peg Solitaire (also known as Hi-Q) has very simple rules. Pegs (red circles in this implementation) are allowed to jump over adjacent (vertically or horizontally) pegs. The peg that has been jumped over is removed.

Now, if you have played the game you know how hard it can be to win.

How about a Peg Solitare Solver - built in Delphi?

A great idea for the Fancy Delphi Application Contest ;-)

Peg Solitare Solver

Peg Solitare Solver computes solutions for the game peg solitaire. This is a board game for one player involving movement of pegs on a 7x7 board with 33 holes. A valid move is to jump a peg orthogonally over an adjacent peg into a hole two positions away and then to remove the jumped peg. The goal is to remove all pegs but one, and this one is to be in the middle of the board.

The program uses a simple backtracking algorithm, and a few extra starting positions are included. To make replays easier, the moves are shown in a memo.

"Peg Solitare Solver" was submitted by "Andreas Dumont".

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

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

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

Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Source Code Projects
  5. Game Programming
  6. Peg Solitare Solver - Fancy Delphi Application Contest Entry #41

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

All rights reserved.