Pegs (Simon Tatham's Puzzles)
Saved games stay in this browser only.
About the puzzle
Pegs is peg solitaire. A board full of pegs has one empty hole. A move jumps a peg over its neighbour into an empty hole on the other side, and the peg that was jumped is taken off the board. Keep going until a single peg is left.
The game has been played in Europe since at least the 17th century, on wooden boards with pegs or marbles. Simon Tatham added it to his collection in 2005, with the two traditional boards and a generator for new ones.
Rules
- A move takes a peg, jumps it horizontally or vertically over an adjacent peg and lands it in the empty hole directly beyond.
- The peg that was jumped over is removed.
- Diagonal jumps are not allowed.
- Spaces with no hole are not part of the board: pegs can neither land on them nor cross them.
- The puzzle is solved when only one peg remains, anywhere on the board.
Controls
| Input | Action |
|---|---|
| Drag a peg | jump it over a neighbour into the hole two spaces away |
| Arrow keys | move the cursor |
| Enter, then an arrow key | jump the peg under the cursor in that direction |
| N / U / R | new game / undo / redo |
How to solve it
Clear the arms first. On the cross-shaped boards, pegs stranded at the end of an arm are the usual way to lose. Bring the arms in towards the centre early, while there are still pegs around to jump over.
Keep the pegs together. A peg with no neighbours can never move again, and it can only be removed if another peg comes to jump it. Each move should leave the remaining pegs in one compact group.
Learn the three-peg clean-up. Three pegs in a line, plus a helper peg beside one end of the line and an empty hole on the opposite side of that end, can be cleared in three jumps: the helper jumps across the end peg, the far peg jumps along the line, and the helper jumps back to where it started. Spotting these blocks of three is how experienced players clear the board in chunks.
Look ahead to the last few. In the final stage you need pegs that can still reach each other. If two pegs are left far apart, the game was lost several moves ago; undo back to where the group split.
Undo is your friend. The board has a lot of possible moves, and many of them look the same. When you get stuck, step back and try a different jump at the point where things went wrong.
Boards
The Type menu has the cross-shaped boards in sizes 5x7, 7x7, 5x9, 7x9 and 9x9 (the 7x7 cross is the traditional English board with 33 holes, starting with the centre hole empty), the 7x7 octagon (the traditional French board with 37 holes, which starts with a different hole empty, because emptying the centre would make it unsolvable), and random boards of 5x5, 7x7 and 9x9 that are always solvable. Custom sets the width, height and board type.
Playing here
Click Play to open the puzzle. The menu above the board has New game, Restart, Undo and Redo (this puzzle has no Solve option), the Type menu with the boards, and the Game menu, where you can type in a game ID or a random seed, download the current game as a file, load a saved file and change the preferences. Your game in progress is kept in this browser and comes back with its whole undo history the next time you open the page.
On a touch screen, drag the pegs with your finger.
Credits and licence
Pegs is part of Simon Tatham's Portable Puzzle Collection, written by Simon Tatham with code contributed by several other authors, and distributed with its source code under the MIT licence. This page runs a WebAssembly build made by FredyGames from the author's official source snapshot, with no changes to the puzzle; the source and the build script are hosted with the game, and the licence text is linked from this page.