Pegs and Holes

This is a program that solves the pegs in holes problem. The premise is that you have a triangular board with a peg in every hole except one (see above). You may jump over one peg with another to get rid of the one jumped over. The object is to end up with only one peg left. Pressing the 5 button will solve for a fifteen peg board, likewise pressing 6 will solve for a 21 peg board. The Next and Prev buttons increment through the steps taken to solve the puzzle.