Peg solitaire

Play peg solitaire on the English cross, the European board or the 15-hole triangle, or draw your own board. Stuck? Hint shows a jump that keeps the game winnable, and Solve finishes it from where you are.

How to play peg solitaire

Peg solitaire is a one-player board game: the board is full of pegs except for one empty hole, and you remove pegs by jumping. A peg jumps over a neighboring peg, straight along a line, into the empty hole just behind it, and the peg it jumped over comes off the board. The goal is to finish with a single peg, and on the English board the classic goal is to finish with that last peg in the center hole. The game is also called brainvita or solo noble; in German it is Solitär or Steckhalma, and in Brazil resta um.

Tap a peg, then tap the hole it should land in (the possible landing holes are outlined). You can also drag a peg over its neighbor. Undo takes back one jump and Restart goes back to the starting position. Your game is saved in this browser, so it survives a reload, and the link button under the board shares the exact position.

The boards

  • English, 33 holes. The plus-shaped cross, the most common board. You start with the center hole empty and try to end with one peg in the center. Jumps go across and up and down, never diagonally.
  • European (French), 37 holes. The cross with four extra holes in the inner corners. Starting with the center empty, one peg is impossible: the best you can do is two pegs. That is why the page starts this board with the hole at c1 empty, a start that can finish with one peg.
  • Triangle, 15 holes. The triangle peg game often found on restaurant tables. Pegs jump along all three directions of the triangle. It starts with the top hole empty.
  • Custom. Choose Draw board and tap points of a 7 by 7 grid to add or remove holes. With Set pegs you can add and remove pegs on any board, to copy a position from a puzzle book or a game in progress.

Holes are named like a chess board: columns a to g from left to right and rows 1 to 7 from the top, so the center of the English board is d4. On the triangle the holes are numbered 1 to 15, row by row from the top.

How the solver works

The solver tries jumps one after another and backs up when a line of play gets stuck, like you would, but it remembers every position it has already proven to be a dead end. A position and its mirror images or rotations are the same puzzle, so one proof covers all of them. It runs in your browser, in the background, and stops after 20 seconds (10 for a hint).

Before searching, it applies an old counting rule. Give every hole a label from 0 to 2 along one diagonal direction, repeating 0, 1, 2, and the same along the other diagonal. Three holes in a row along any jump line always carry three different labels, so every jump changes the number of pegs on each label by exactly one. Some sums of those counts therefore never change parity, whatever you do, and when the start and the goal disagree the goal is impossible. This is how the solver can prove right away that the European board with the center empty can never end with one peg.

When the goal you picked cannot be reached, Solve says so and finds the best result that can: one peg anywhere, or the fewest pegs. When it cannot finish within the time limit, it says so instead of guessing.

What we checked

Every solution is replayed jump by jump on a separate model of the board before we trust the solver. In our tests it finds the English board's solution to the center from the standard start, 31 jumps, in well under a second. On the English board, all 33 starting holes can be solved to one peg. On the triangle, every one of the 15 starting holes can be solved to one peg; starting from the top, the last peg can only end on hole 1, 7, 10 or 13. On the European board, the counting rule allows one peg from only 16 of the 37 starting holes, and the solver found a one-peg solution for all 16.

Tips

Clear the arms of the cross early: pegs stranded at the end of an arm are the usual reason a game ends with several pegs. Work in blocks of three, using one peg as a helper that ends where it started. Avoid isolating a peg with no neighbors, since nothing can ever jump it. If a game goes wrong, press Hint: it only suggests a jump from which the goal is still reachable.

Another one-player puzzle where every move changes what the next one can do is Lights Out. For a two-player board game, try nine men's morris.

Solver tested . Found a problem? Tell us.

Questions

What is the solution to peg solitaire?

On the English 33-hole board, starting with the center empty, a solution takes 31 jumps, since every jump removes one peg and 32 pegs must go. There are many solutions. Press Solve on the starting position and step through one with the move list, or play a few jumps first and solve from there.

Can every peg solitaire position be solved to one peg?

No. Many positions reached in a game can no longer be cleared to one peg, and some starts are impossible from the beginning, like the European board with the center empty. The solver tells you when your goal has become impossible, and shows the best result that is still possible.

What is the difference between jumps and moves?

A jump is one peg jumping one other peg. A move counts a run of consecutive jumps by the same peg as one move, the way peg solitaire records are usually counted. The page shows both, so a solution of 31 jumps may be fewer moves.

How do you win the triangle peg game?

Start with the top hole empty and leave one peg. Our solver proves that from that start the last peg can end only in hole 1 (the top), 7, 10 or 13, numbering the holes row by row from the top. Choose Triangle 15 and press Solve to see a solution.

Is the hint always safe?

When the hint finds a jump, the solver has already found a full solution that starts with it, so your goal is still reachable after that jump. If the goal is no longer possible, the hint says so and aims for the best result left. If it cannot decide within 10 seconds, it tells you instead of guessing.

Does the solver find the fewest moves?

No. It finds a solution, not the shortest one in moves. Finding the fewest moves is a much harder search, so it is not done here.