Cairn

You build cairns here, the heaps of stones people stack up as markers, and they take the form of columns on the board. None is ever safely yours: every column is only borrowed, so what counts is what you take before it changes hands.

How to play

A turn is one stone added to any column, and you each have a fixed number to spend.

  1. Tap a column A stone in your colour goes on top, and that column is now yours. Columns you may not build on are dimmed.
  2. Remember it can be taken back Anyone who legally adds to a column becomes its new owner. A column is only yours until somebody covers it.
  3. Build columns nobody can reach A column already two above both neighbours is illegal for everyone, including the computer. Those points are locked in.
Full instructions

In depth

Winning a stone stacking duel against the computer

How columns are claimed and stolen, why the leaning rule decides everything, how the computer searches for the best move, and the tactics that turn borrowed columns into permanent points.

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

The idea behind the game

Cairn is a two-player strategy game played against the computer. A row of columns sits in front of you. You and the computer take turns placing one stone on any column. Whoever places the top stone on a column owns it. When all stones have been spent, you score one point for every column whose top stone is yours.

The twist is that ownership changes. If the computer places a stone on a column you own, that column is now the computer's. Nothing is final until nobody can build any higher. Every column is borrowed until the game proves otherwise.

The leaning rule

A column may never finish more than two taller than both of its neighbours. Think of it as a tower that needs something nearby to lean on. If both neighbours are short, the column cannot keep growing.

The ground outside the row counts as height zero. That matters most for the two end columns. An end column has one real neighbour on one side and the ground on the other. It becomes illegal to build on at a lower height than a column in the middle, because the ground never grows.

When a column is too tall for anyone to add to it, its owner has locked in that point. Nobody can steal it. The column is safe for the rest of the game. This is the most important thing in Cairn. A safe column is worth more than an unsafe one, because an unsafe column might change hands three more times before the stones run out.

Board sizes and stone counts

Three sizes are available. Small gives you five columns and eight stones each. Medium gives seven columns and eleven stones. Large gives nine columns and fourteen stones.

The stone count matters more than the column count. With eleven stones and seven columns, there are not enough stones to fight over every column. You must choose which ones to contest and which to let go. Spreading your stones across every column wastes them. The player who concentrates on fewer columns and locks them in will usually win.

Controls and the flow of a turn

Tap a column to place a stone. Your stone appears in your colour on top of the stack, and the column is now yours. Columns that are illegal to build on are dimmed and cannot be tapped.

After your move, the computer thinks for a moment and places its own stone. The scoreboard updates after each turn, showing how many stones you have left, how many columns you top, and how many the computer tops. The note below the board tells you which column the computer chose.

Press New Game to start over. Changing the board size also starts a fresh game.

How the computer decides

The computer searches ahead using a method called alpha-beta pruning. It looks at the current position, tries every legal move, then tries every response to each of those, and so on, several layers deep. At each position it counts how many columns each side tops, with extra weight for columns that are locked.

It also remembers positions it has already evaluated, so it does not repeat work. When several moves look equally good, it picks one at random, which is why it does not play the same game twice.

All of this runs on your device. The search is small enough to finish in a fraction of a second, because the number of columns is modest and the stone budget limits how deep the game can go.

Locking the end columns early

The cheapest points on the board are the two end columns. Because one of their neighbours is the ground at height zero, they become illegal to build on at a lower height than any middle column. A stack of three at the end with nothing beside it is already locked, because the next stone would be more than two above both the ground and the one neighbour.

Early in the game, race to top an end column and then build beside it just enough to keep the other end reachable. If you lock both ends, you start with two safe points and the computer has to fight for everything in the middle.

The staircase trap

Every stone you place raises a column by one. That lifts the ceiling for the columns next to it, because they are now allowed to be two taller than a higher neighbour. In other words, building up in one spot unlocks the spots beside it.

This is how the computer steals your columns. You build column four to height five, and suddenly column three can reach seven, and column five can reach seven. The computer places on a column you thought was safe, because your own building raised the limit.

The fix is to think about what your move allows, not just what it claims. Before you tap, look at the neighbours. Will raising this column let the computer reach a column you already own? If so, consider placing somewhere else first.

Spending the last stones

The endgame is where most games are decided. When you have three or four stones left, every placement must count. There are two mistakes to avoid.

The first is topping a column the computer can immediately cover. If the computer has stones left and the column is still legal to build on, you have wasted your stone. Count the computer's remaining supply before you place. If it has enough to cover you, that column is not safe.

The second is saving stones for too long. If you hold back while the computer places freely, it may lock several columns before you act. There is a balance between patience and urgency. The best approach is to place on columns you can lock in one move, because those points are guaranteed.

A safe column is worth two points

When you lock a column, you gain a point and deny the computer a point. That is a swing of two. Compare this with topping an unsafe column. You gain a point now, but the computer can take it back on its next turn, which means you gain nothing and spent a stone.

This is why the game rewards defensive building more than aggressive claiming. The player who locks three columns will usually beat the player who briefly tops five but locks none. Focus on permanence.

Reading the scoreboard

Three numbers track the game as it unfolds. Your stones shows how many you still have to place. Columns you top counts the columns where your stone is currently on top. Computer tops counts the same for the other side. The total of these two counts plus any empty columns always equals the board width.

After the last stone is placed and neither side can legally build, the game ends. The side with more columns topped wins. If both sides top the same number, the result is a draw. Draws are uncommon but they do happen, especially on the small board where five columns and eight stones leave room for an even split.

Common mistakes and how to avoid them

  • Placing on every column to get a high count early. Those columns will all change hands, and you will run out of stones before you can defend them.
  • Ignoring the computer's stone count. If it has seven left and you have three, it can outlast you on any column that is still open.
  • Building the middle columns first. The ends are cheaper to lock. Start there.
  • Raising a column without checking what it opens for the neighbours. The leaning rule works both ways.
  • Playing the first move on a column the computer can immediately cover and lock. Look at the heights around your target before you tap.
  • Forgetting that a draw is possible. When each side tops the same number of columns, the game is tied. If the computer is ahead by one, you need to steal two columns, not one, because taking one from it and giving yourself one changes the gap by two.

No data leaves your browser

The computer opponent runs entirely on your machine. There is no server involved in any part of the game. The search algorithm, the board state, and your score history all live in your browser. You can play offline after the page loads and nothing will change about how the game works.

Help

How to play Cairn

A turn is one stone added to any column, and you each have a fixed number to spend. No column may end up more than two taller than both its neighbours, and the ground beyond the row counts as height zero, so the two end columns are propped on one side only. When the stones run out you score a point for every column whose top stone is yours.

Tap a column

A stone in your colour goes on top, and that column is now yours. Columns you may not build on are dimmed.

Remember it can be taken back

Anyone who legally adds to a column becomes its new owner. A column is only yours until somebody covers it.

Build columns nobody can reach

A column already two above both neighbours is illegal for everyone, including the computer. Those points are locked in.

Spend your last stones carefully

Claiming a column the computer can simply cover on its next turn wastes a stone. Count what it has left.

What the computer is doing

It searches with alpha-beta pruning over the whole position — the heights, who tops each column, and how many stones each side has left — and remembers positions it has already valued. It judges a position by how many columns it tops against how many you do, with a bonus for columns that are now illegal to build on, because those points can never be taken back. It shuffles between equally good moves so it does not play the same game twice, and all of it runs on your device.

Good to know

A safe column is worth two

Topping a column that is now illegal to build on gains you a point AND denies one, because it can never change hands again.

The ends lock first

An end column is measured against the ground, so it becomes untouchable at a lower height than a middle one. They are the cheapest points on the board.

Raising a column unlocks its neighbours

Every stone you add gives the neighbouring columns more room to grow — often handing the computer the very column you had just secured.

Going second on a column is better

Whoever places last on a column keeps it, so there is real value in holding a stone back rather than claiming early.

Common questions

What exactly makes a column illegal?
It would finish more than two above BOTH neighbours. More than two above only one of them is fine — that is what makes staircases work.
Do the ends count as having a neighbour?
They have one real neighbour and the ground, which counts as height zero.
What if I cannot place a stone anywhere?
Your remaining stones are forfeit and the computer plays out its own. That is rare, but it is why building yourself into a corner costs more than a turn.
Can the game be drawn?
Yes, when you top the same number of columns each.
Is this an existing game?
No, it was designed for this site. An earlier version had no stone limit and gave the win to whoever left the other stuck — but a level row is legal everywhere, so that game never ended. The stone budget is what makes it finite.