Peg Solitaire is a game that is traditionally played on a wooden board that has a pattern of holes drilled, each of which can contain a peg. The rules of the game are very simple: you make moves by jumping a peg over an adjacent peg, much like in checkers, except that the moves must be horizontal or vertical. The peg jumped over is removed. The aim of the game is to remove all the pegs except the last, which should be left in the center of the board.
Peg Solitaire, starting position
When I played this game as a child, I could never manage to win, and I even began to suspect it was not possible! I wrote this program to find out if it was possible, and also to find out just how easy it is to win. This program does this by providing an option to show all the moves that will allow you to reach the winning position, from any point in the game.
This image shows a game of peg solitaire in progress. The option to show the winning moves is turned on, so the pegs glow to show which ones to move.