Puzzles you move and think about

Sliding cars, skating on ice, pushing boxes, switching off lights. Four different puzzles share one question: what counts as a move? Plus the mathematics hiding behind small boards.

In these puzzles you slide pieces, or yourself, toward a goal. All four look gentle, but ask “what counts as one move?” or “how far ahead should I look?” and they get deep.

Traffic Jam Puzzle (the site’s “Traffic Jam Puzzle”)

On a crowded board, slide the cars to get the red car out of the exit. Each car moves only along the direction it faces. On this site, sliding one car any distance counts as one move. The minimum for each of the 40 levels was checked by breadth-first search (looking at positions nearest the start first, until all are covered). This site’s program checked these numbers.

This kind of puzzle, a car-sliding puzzle, is said to have been devised by the Japanese puzzle designer Nob Yoshigahara (1936–2004) and became widely known after it was sold abroad in the 1990s. Sources disagree on when he devised it: the 1970s, or the late 1970s. Sliding pieces until a target piece reaches an exit is an old idea, shared with the classic Hakoiri Musume. But there is no evidence strong enough to say that one grew out of the other.

Researchers showed that if you let this kind of sliding-block puzzle grow to any size, deciding whether it can be solved belongs to a very hard family of problems (PSPACE-complete). On small boards like the ones here, though, a computer can simply search everything and find the best answer. It is worth not overstating “hard”.

Ice Slide (the site’s “Ice Slide”)

On ice you cannot stop where you like. You keep sliding until you hit a wall or the edge of the board. Sliding across the goal does not finish the level; you must stop on it. Here, one slide is one move.

This trick is a familiar kind of puzzle in video games. Who first made it, and when, is not known.

The key idea is to count only the places where you can stop. Only those stopping places become the next position, so there are far fewer positions to look at than on an ordinary board. The minimum for each of the 24 levels (three each from 2 to 9 slides) was checked by breadth-first search built on this idea. This site’s program checked these numbers.

Box Pusher (the site’s “Box Pusher”)

Walk around a warehouse and push every box onto a goal square. You can push a box but never pull it. That is where the difficulty comes from: push a box into a corner by a wall and it can never move again. Here, every single step counts as one move, including a step that pushes a box. The minimum walking steps for the 12 levels (6 to 16 steps) were checked by breadth-first search. This site’s program checked these numbers.

This genre is said to have been born in Japan around 1981–82. In 1997 Joseph Culberson showed that deciding whether such a puzzle can be solved belongs to a very hard family of problems (PSPACE-complete). It looks like a child’s toy, yet in computer science it is among the hardest kinds of problem. Small boards, of course, can still be solved normally.

Toggle Lights (the site’s “Toggle Lights”)

Press a cell and that cell and its up, down, left and right neighbors flip. Turn every light off to win. You can choose 3×3 or 5×5. Similar play is said to have existed in electronic toys of the 1970s and 80s.

There is mathematics hiding here. Pressing the same cell twice cancels out. And the order of presses does not matter. So each cell needs only a yes-or-no decision: press or do not press. This site’s program checked these two properties (twice cancels, order does not matter).

If you calculate in a world of only 0 and 1 where 1 + 1 = 0, the whole board becomes a system of equations. This is called linear algebra over the field with two elements, and it is presented in a 1998 paper by Anderson and Feil.

A handier method is to clear the board from the top. Once you decide the presses in the top row, the presses for row two onward are forced: “clear the light directly above.” On 5×5 the top row has only 2 to the 5th power, 32, patterns. This site’s program tried all 32 to find the minimum and confirmed that it matches the answer of each puzzle. For 3×3, the best counts agree with a separate breadth-first search for all 512 boards.

And on 5×5 there are boards that cannot be fully cleared. For example, a board with only the top-left corner light on cannot be cleared by any presses. The test checks this too.

Tilt Maze (the site’s “Tilt Maze”)

Tilt the board up, down, left or right and every ball rolls until it hits a wall or another ball. A ball that rolls over a hole drops in and plugs it. Sink all the balls to win. Here each tilt is one move. You may want to move only one ball, but all of them move together, so using walls and other balls as brakes is the skill.

  • A rolling ball stops behind a ball ahead of it. The calculation moves the leading ball first.
  • If every ball is already stopped in that direction, tilting that way does nothing.

For every one of the 15 or more levels, this site’s program found the shortest number of tilts by breadth-first search and replayed that solution to confirm it clears the level.

Rolling Die (the site’s “Rolling Die”)

Roll a die one square at a time across a grid. Reach the goal square with the requested face on top. Each roll over one square is one move. On a die, opposite faces add up to 7. This site’s program checked that in every orientation, opposite faces add to 7 and the six faces are all different.

  • Rolling four times in the same direction brings the die back to where it started.
  • Rolling the opposite way undoes a roll.
  • The die can end up in exactly 24 different orientations.

You must think about which face will be on top as well as where you will land, so a detour can be the right answer. For all ten or more levels the program checked the shortest number of rolls by breadth-first search, and it also checked that from every reachable position there is still a way to the goal.

Train Shunting (the site’s “Train Shunting”)

Cars wait in a line at the entry. Send the front car, one at a time, to the exit or into a siding, and line the cars up at the exit in the target order. Moving one car is one move. A siding is a dead end, so the car that went in last comes out first. This last-in, first-out arrangement is what computer science calls a stack.

For example, to turn cars arriving as 1, 2, 3 into 3, 2, 1 at the exit, one siding is enough and it takes 5 moves. The program checked that this hand-worked count agrees with the search. It also checked the shortest number of moves for all ten or more levels, which use three to five cars, by breadth-first search. If a wrong car has already gone out to the exit, the target can no longer be reached, so the hint honestly says it cannot be reached.

Chinese Rings (the site’s “Chinese Rings”)

Remove every ring, one legal move at a time. The first ring can always be put on or taken off. Any other ring moves only when the ring just before it is on and every ring before that is off. Here putting one ring on or taking it off is one move. In every position only the first ring and at most one other ring can move. The program checked this for every position with up to nine rings.

The shortest number of moves as the number of rings grows is:

  • For 1 to 9 rings: 1, 2, 5, 10, 21, 42, 85, 170, 341 moves.
  • As a formula, with n rings, it is 2 to the power n + 1, divided by 3, rounded down.

With nine rings that is 341 moves. The program confirmed the same numbers for 1 to 9 rings both by the formula and by breadth-first search. Also, the 2 to the power n possible arrangements of rings are linked together as a single path. There are no forks, so you may wander back and forth but you cannot get lost at a junction.

Binary numbers hide along this path. Write the state as a string of 1s (on) and 0s (off), and each move changes exactly one place in the string. Such an ordering is called a Gray code. Starting from all rings off and moving rings, the program confirmed with nine rings that the states appear exactly in Gray-code order. Moreover, for every state, the number of moves still needed to remove everything equals the number you get by reading that string as a Gray code and converting it into an ordinary binary number.

We have no sourced record to point to for where and when this puzzle was born.

“One move” differs from game to game

  • Traffic Jam Puzzle: sliding a car any distance is one move.
  • Ice Slide: sliding until you stop is one move.
  • Box Pusher: every step is one move, and so is a step that pushes.
  • Toggle Lights: one press is one move.
  • Tilt Maze: one tilt is one move, and every ball moves together.
  • Rolling Die: rolling one square is one move.
  • Train Shunting: moving one car is one move.
  • Chinese Rings: putting one ring on or off is one move.

Change how moves are counted and the “shortest” answer changes. That is why Hakoiri Musume has two answers, 81 and 116 moves. When you see a number, first ask what it counts as a move.

In each of these works, hints start with the idea. Look at only that first, then try again yourself.

Sources

Updated: 2026-10-17