Pentago — Place, Twist, Five in a Row

Play Pentago against the computer, and see why its 288 opening moves are really only six — and when the compulsory twist nearly costs you a win.

Place a marble, then twist one quadrant a quarter turn. Five in a row wins — and the win is checked after the twist, so you can win by twisting alone.

The first move looks like 288 choices and is actually 6

36 squares × 4 quadrants × 2 directions = 288 opening moves. Generate all of them and reduce to distinct positions and you are left with 6 — a factor of 48. It comes from two places at once:

  • 224 of the 288 twists do nothing at all. Twisting any of the three quadrants your marble is not in obviously changes nothing, which accounts for 216. The other eight are the four quadrant centres: a marble on the middle of a quadrant sits exactly on the axis, so twisting its own quadrant leaves it alone too. Open on a centre and all eight of your twist options are identical.
  • The board has the eight symmetries of a square, which collapses the handful of genuinely different placements further.

So agonising over which way to twist on move one is agonising over nothing. It only begins to matter once there is something in more than one quadrant to move — with two corners occupied, four of the eight twists change the board instead of none.

The compulsory twist can never cost you a win — but only just

The twist is not optional, which raises an unpleasant thought: could you place your fifth marble in a row and then be forced to twist it apart? No. Across 5,498 sampled positions holding a five, there was not one where every quadrant would break it.

But the comfortable argument for why — “a five spans two quadrants, so at least two are always safe” — is wrong, and wrong for a specific reason. A straight five does span two quadrants, and so does the main diagonal. An offset diagonal spans three: run from row 2 column 1 down to row 6 column 5 and you pass through three of the four quadrants, leaving a single quadrant you can safely twist.

So the measured minimum is one safe quadrant, not two — 707 of the sampled positions were down to a single safe twist. The rule never quite bites, and it comes a good deal closer than the reasoning suggests.

How to use

  1. Place a marble on any empty square.
  2. Then twist one of the four quadrants a quarter turn.
  3. Five in a row wins, counted after the twist.
  4. Watch for wins made by twisting alone, for either side.

Frequently asked questions

How many opening moves does Pentago have?

Thirty-six squares times four quadrants times two directions is 288 on paper, but only six of them lead to genuinely different positions. Most of the twists change nothing, and the board symmetries collapse the rest.

Why do most Pentago twists do nothing on the first move?

Because 224 of the 288 leave the board exactly as it was. Twisting any of the three quadrants your marble is not in obviously changes nothing, and a marble placed on a quadrant centre sits on the axis of rotation, so twisting its own quadrant leaves it alone as well.

Does it matter which way you twist on move one?

No. Every opening reduces to one of six positions, so the choice is genuinely empty. It starts to matter as soon as there are marbles in more than one quadrant — with two corners occupied, four of the eight twists change something instead of none.

Can the compulsory twist force you to break your own five?

No. Across 5,498 sampled positions holding a five in a row, there was never one where every quadrant would break it. There is always at least one safe twist.

Is it true that a five always leaves two safe quadrants?

No, and that is the common argument gone wrong. A straight five spans two quadrants and so does the main diagonal, but an offset diagonal spans three, leaving only one quadrant you can safely twist. The measured minimum is one, not two, so the rule comes closer to biting than the reasoning suggests.

When is the winner decided in Pentago?

After the twist, not after the placement. That means you can win by twisting alone, without placing anything relevant, and it also means your own twist can hand five in a row to your opponent.

What happens if both players get five at once?

It is a draw under the usual rule, since the position is checked after the twist and neither line came first. It is rare, but a single twist can complete lines for both sides at the same time.

Does this send anything anywhere?

No. The game and the opponent both run entirely in your browser.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.