Anthill

The ant walks by itself and nothing you do will steer it. All you can do is lay out the hill so that its way round comes out longer, and getting it long enough is the puzzle.

How to play

Pebbles are the only thing you place, and the ant walks around them without being steered.

  1. Look at the route The pale trail is one shortest route the ant could take right now, and the scoreboard gives its length.
  2. Drop a pebble Tap any open square, and tap a pebble again to pick it back up. Squares that would seal the crumb off completely are refused.
  3. Block where every route must pass A pebble beside a wide corridor achieves nothing — the ant just steps round it. Only a square that all the shortest routes share will lengthen the walk.
Full instructions

In depth

Steering a path you cannot steer

Anthill is a puzzle about shortest paths. An ant sits at its nest and wants to reach a crumb on the other side of the grid. It always takes the shortest route, and you cannot tell it otherwise. The only thing you can do is drop pebbles onto the grid, which the ant walks around. Your goal is to make the shortest route exactly a certain length, not too short and not too long. This article covers how the puzzle works, the controls, the rules about pebble placement, and the thinking that turns a grid of squares into a solved board.

Screenshot: How to play Anthill
How to play Anthill as it appears when the page opens.

How the puzzle works

The grid shows a nest and a crumb, dropped on two random open squares rather than in fixed corners, along with a scatter of fixed rocks that were there before you arrived. The ant moves from square to square, one step at a time, and it can only go up, down, left, or right. It cannot move diagonally. It always takes the shortest route from the nest to the crumb, and the game draws one such route on the grid as a pale trail.

Your job is to drop pebbles onto empty squares. The ant cannot step on a pebble, so it has to walk around them. Each pebble you place might change the shortest route, making it longer. The scoreboard shows the current route length, and the puzzle gives you a target length. When the shortest route is exactly the target length, you have won.

Placing and removing pebbles

Tap any open square to drop a pebble on it. Tap a pebble to pick it back up. You can place and remove pebbles as many times as you like. The route redraws itself after every change, so you always see the effect of what you just did.

There is one restriction. The game will not let you place a pebble that would seal the crumb off entirely. An ant with no route at all has not been sent the long way round; it has been trapped, and that is not the puzzle. Any placement that would leave no path from the nest to the crumb is simply refused.

Controls and difficulty levels

The Ground dropdown offers three sizes: Small, Medium, and Large. A small grid has fewer squares and fewer pebbles to work with, so the puzzle tends to be more direct. A large grid has more room, which means more possible pebble positions and a longer target route. The puzzles on larger grids require more careful thinking about where the bottlenecks are.

A New game button generates a fresh puzzle at any time. You do not have to use all the pebbles available. If the route hits the target length with pebbles left over, you have still won. The pebble count is a limit, not a requirement.

Find the bottleneck

The most important skill in Anthill is learning to read the trail and find the bottleneck. A bottleneck is a square that every shortest route must pass through. If the trail has to go through a narrow gap between two obstacles, every pebble you place near that gap changes the route. A pebble placed far from the trail, where the ant has plenty of room to go around, achieves nothing.

Look at the trail carefully after each pebble. Ask yourself: is there a square where the trail is squeezed into a one-square-wide corridor? That is where your next pebble matters. Placing it right at that narrow point forces the ant into a longer detour. Placing it in the middle of an open field does not change the route at all.

Detours usually add two, not one

When an obstacle forces the ant to step sideways, it costs a step out and a step back. That means most detours add two to the route length, not one. This is because the ant moves on a grid without diagonals. Going one square to the left and then one square to the right to get past a pebble costs two extra steps compared to walking straight through.

This has a practical consequence. If you need to add three to the route length, you cannot always do it with one pebble. One pebble in a tight spot might add two, and then you need another arrangement to add the remaining one. Understanding that lengths tend to move in even jumps helps you plan which pebbles to place and where to put them. Odd increases are possible but they usually require a pebble at a corner or near an edge where the geometry is different from the open grid.

The trail moves as you place

A common trap is to find a good bottleneck, place a pebble there, and then keep looking at the same spot. But the trail has moved. Blocking one route makes a different route the shortest, and the squares worth blocking change with it. You need to re-read the trail after every pebble.

Sometimes a pebble that helped earlier becomes useless after a later pebble changes the trail completely. When that happens, pick the first one up and try it somewhere else. Since you can remove pebbles freely, there is no penalty for moving them around as the picture changes.

Where the target length comes from

Each puzzle is generated by placing pebbles at random on the grid, making sure none of them cuts the crumb off entirely. The game then measures the shortest route that results, and that length becomes the target. This means the target is always a length the board can actually produce. The board is also checked to make sure the target is meaningfully longer than the open-grid distance, since a target only one step above the minimum would be no puzzle at all.

The shortest route is found by breadth-first search, which checks every possible path starting from the nest and expanding outward one step at a time. This is why the word shortest is exact, not approximate. Every route of a given length is found before any longer route is considered.

Common mistakes and how to fix them

A few patterns come up often when people are learning the game, and each one has a straightforward fix.

  • Placing pebbles far from the trail. Only pebbles on or very near the current shortest path can change the route length. A pebble in an empty corner does nothing.
  • Trying to make the route as long as possible. The target is an exact number. Going over is just as wrong as falling short, so do not pile pebbles on blindly.
  • Forgetting you can pick pebbles back up. A pebble that helped when the trail ran one way might be useless now. Move it to where the new trail is squeezed.
  • Placing a single pebble in a wide-open area and expecting it to help. The ant needs only one clear square to go around a lone pebble in open ground, and that barely changes the route.
  • Not re-reading the trail after each change. The trail redraws every time, and the bottleneck shifts with it. What mattered a moment ago may not matter now.

Strategy for hitting the exact number

Start by looking at how far the current route length is from the target. If the gap is large, you need pebbles in places that force big detours. A pebble that blocks a narrow corridor between two walls can add four or six steps in one move. If the gap is small, be more careful and place pebbles that add only two steps each.

Work in stages. Close the gap by half, then re-read the trail. Close it by half again. As you get closer to the target, each pebble placement becomes more precise. If you overshoot, pick up the last pebble and try a position that adds less. Since placement and removal are free, this trial approach costs nothing.

Everything stays on your device

The puzzle runs entirely inside your browser. Nothing is uploaded, there is no account, and once the page has loaded it works offline. The route calculation, the pebble logic, and the puzzle generation all happen right here on your device. There is no limit on how many puzzles you play, and no registration or sign-up is needed.

No personal data is collected or stored. Your progress stays in this browser on this device only, and clearing your browser data is the only way to lose it.

Help

How to play Anthill

Pebbles are the only thing you place, and the ant walks around them without being steered. The target length has to be hit exactly, so too short means you have not blocked enough and too long is just as much a failure. Its current route is drawn on the ground with the length beside it, which lets each pebble be judged as you put it down.

Look at the route

The pale trail is one shortest route the ant could take right now, and the scoreboard gives its length.

Drop a pebble

Tap any open square, and tap a pebble again to pick it back up. Squares that would seal the crumb off completely are refused.

Block where every route must pass

A pebble beside a wide corridor achieves nothing — the ant just steps round it. Only a square that all the shortest routes share will lengthen the walk.

Hit the number exactly

The puzzle is won the moment the route is exactly the length wanted, however many pebbles you have used.

Where the target length comes from

Each board is generated by dropping the pebbles at random — refusing any that would cut the crumb off — and then measuring the shortest route that results. That measured length becomes the target, so it is always a length the board can actually produce. Boards are rejected when the pebbles barely lengthened the walk, since a target only one step longer than the open ground is no puzzle at all. The route itself is found by breadth-first search, which is what makes "shortest" exact rather than approximate.

Good to know

Find the bottleneck

Look for a narrow gap the trail has to pass through. Those are the only squares where one pebble changes anything.

Each detour adds two, not one

Going around an obstacle usually costs a step out and a step back, so route lengths tend to move in twos.

The trail moves as you place

Blocking one route makes another the shortest, and the squares worth blocking change with it. Re-read the trail after every pebble.

You need not use every pebble

The count is a limit, not a requirement. If the route is right with two left over, you have won.

Common questions

Can the ant move diagonally?
No, only up, down, left and right — which is why detours usually cost two steps.
What if there are several equally short routes?
It does not matter. Only the length counts, and all the shortest routes have the same one.
Why will it not let me place a pebble?
Because it would seal the crumb off entirely. An ant with no route has not been sent the long way round.
Do I have to use all the pebbles?
No. Hitting the exact length is the only thing that matters.
Is there only one answer?
Usually not — several arrangements often give the same route length, and every one of them counts.