Triangle Peg Game Solver

Play the 15-hole triangle peg game, ask for a hint when you are stuck, or have the solver finish it for you step by step. It works from any position, tells you when a position can no longer be won, and can aim for the last peg in a hole you choose.

Pick a peg, then the empty hole it should jump into.

How to play

  1. Pick the empty starting hole. Every other hole starts with a peg, so you begin with 14 pegs.
  2. A move is a jump: a peg hops over a neighbouring peg in a straight line into the empty hole just past it, and the peg it jumped over is removed. Tap or click the peg, then the hole. With a keyboard, Tab to a hole and press Enter or Space; Escape puts a picked peg back.
  3. Keep jumping until no jump is left. The fewer pegs remain, the better. Use Undo to take moves back, Hint for the next good jump, or Solve from here for the full list.

Scoring: leave one and you're a genius

The scorecard that comes with the classic wooden version reads roughly: leave one peg and you're a genius, two and you're pretty smart, three and you're just plain average, and four or more and, well, keep practising. Every starting hole can be solved to one peg.

Worked example: top hole empty

Holes are numbered from the top, left to right in each row: 1 on top, 2 and 3 below it, down to 11 to 15 along the bottom. With hole 1 empty, this sequence leaves the last peg back in hole 1. Each step is the jumping peg and the hole it lands in:

4→1, 6→4, 1→6, 7→2, 10→3, 12→5, 14→12, 11→13, 13→6, 3→10, 15→6, 6→4, 4→1

Every jump removes exactly one peg, so every solution from a 14-peg start is 13 jumps long, so measured in jumps every solution is equally short. George Bell counted 6,816 solutions that start and end in hole 1, and the solver finds the same number.

Solutions for every starting hole

These counts were computed by this page's solver: the number of different move sequences that end with one peg in any hole, verified by an exhaustive search of every line of play. They are not taken from a published source. The only published figure we cite is the 6,816 solutions from hole 1 back to hole 1 in George Bell's Solving Triangular Peg Solitaire (Journal of Integer Sequences, 2008; OEIS A120422), and the solver finds the same number.

Empty holeSolutionsLast peg can end inOne solution
129,7601, 7, 10, 134→1, 6→4, 1→6, 7→2, 10→3, 12→5, 13→6, 2→9, 3→10, 15→6, 6→13, 14→12, 11→13
214,8802, 6, 11, 147→2, 1→4, 9→7, 3→8, 7→2, 10→3, 12→5, 2→9, 14→12, 11→13, 13→6, 3→10, 15→6
314,8803, 4, 12, 1510→3, 1→6, 8→10, 2→9, 7→2, 10→3, 14→5, 3→8, 12→14, 15→13, 13→4, 2→7, 11→4
485,2583, 4, 9, 12, 151→4, 6→1, 4→6, 10→3, 1→6, 13→4, 7→2, 15→13, 12→14, 14→5, 6→4, 2→7, 11→4
51,5501312→5, 10→8, 2→9, 3→10, 7→2, 1→4, 14→12, 4→13, 12→14, 15→6, 6→13, 14→12, 11→13
685,2582, 6, 8, 11, 141→6, 4→1, 6→4, 7→2, 1→4, 12→5, 4→6, 10→3, 14→12, 11→13, 13→6, 3→10, 15→6
714,8801, 7, 10, 132→7, 6→4, 1→6, 7→2, 10→3, 12→5, 13→6, 2→9, 3→10, 15→6, 6→13, 14→12, 11→13
81,55063→8, 10→3, 13→6, 3→10, 7→9, 2→7, 11→4, 15→13, 12→14, 14→5, 4→6, 10→3, 1→6
91,55042→9, 7→2, 12→5, 3→8, 10→3, 1→6, 14→12, 6→13, 12→14, 15→13, 13→4, 2→7, 11→4
1014,8801, 7, 10, 133→10, 4→6, 1→4, 7→2, 10→3, 12→5, 13→6, 2→9, 3→10, 15→6, 6→13, 14→12, 11→13
1129,7602, 6, 11, 144→11, 1→4, 9→7, 3→8, 7→2, 10→3, 12→5, 2→9, 14→12, 11→13, 13→6, 3→10, 15→6
1214,8803, 4, 12, 1514→12, 4→13, 1→4, 3→8, 7→2, 10→3, 12→5, 13→6, 3→10, 15→6, 6→4, 2→7, 11→4
1385,2581, 5, 7, 10, 134→13, 1→4, 3→8, 7→2, 10→3, 12→5, 13→6, 2→9, 3→10, 15→6, 6→13, 14→12, 11→13
1414,8802, 6, 11, 1412→14, 4→13, 1→4, 3→8, 7→2, 10→3, 13→4, 2→7, 11→4, 14→5, 4→6, 3→10, 15→6
1529,7603, 4, 12, 156→15, 1→6, 8→10, 2→9, 7→2, 10→3, 14→5, 3→8, 12→14, 15→13, 13→4, 2→7, 11→4

Why some finishes are impossible

Colour the holes in three colours so that every straight line of three holes has one of each: holes 1, 5, 7, 10 and 13 are one colour; 2, 6, 8, 11 and 14 the second; 3, 4, 9, 12 and 15 the third. A jump empties two holes of two colours and fills one of the third, so each colour's count goes up or down by one and all three flip between odd and even together. Which colours are odd relative to each other never changes.

A full board has five pegs of each colour. Take one out and that colour is the odd one out for the rest of the game, so a single last peg must sit on a hole of the same colour as the starting hole. That rules out two thirds of the board. Not every same-colour hole is reachable either: from hole 1 the last peg can land in 1, 7, 10 or 13 but not 5. The solver settles those cases by trying every line of play.

How the solver works

Each position is stored as a 15-bit number, one bit per hole, so there are only 215 = 32,768 possible positions. The solver runs a depth-first search over the jumps and remembers which positions are winnable, so it never solves the same position twice and answers instantly. Its tests check every one of the 32,768 positions against a separate brute-force search.

Common questions

How do you solve the 15-hole triangle peg game?
Every one of the 15 starting holes can be solved to one peg, always in 13 jumps. The worked example on this page solves it from the top hole back to the top hole, and the table lists one solution for every starting hole. For any other position, play it out on the board and press Solve from here.
Can every starting hole be solved to one peg?
Yes. Every one of the 15 starting holes can finish with a single peg. Starting in the middle of an edge (holes 4, 6 and 13) gives the most solutions and starting in one of the inner holes (5, 8 and 9) the fewest; the table on this page has the exact counts.
Why can the last peg not finish in some holes?
Colour the holes in three colours so every straight line of three holes has one of each. A jump takes one peg off two colours and adds one to the third, so the odd-or-even pattern between colours never changes. From a full board less one hole, that forces the last peg onto a hole of the same colour as the starting hole.
Is this the Cracker Barrel peg game?
It is the same traditional 15-hole triangle puzzle that Cracker Barrel restaurants put on their tables. This page is independent and is not affiliated with or endorsed by Cracker Barrel Old Country Store, Inc.
Are my moves saved or sent anywhere?
No. The solver runs in your browser. Your moves are not stored, logged or put in the URL.

Not affiliated with or endorsed by Cracker Barrel Old Country Store, Inc. More puzzles on the tools page.