Beating a perfect opponent at the golden ratio coin game
How Hoard works, why the losing positions follow a pattern tied to the golden ratio, the small positions to memorise, and how to hand the machine a bad deal on every single turn.

Two piles and one rule
Two piles of coins sit in front of you. On your turn you take any number of coins from one pile, or the same number from both piles. You must take at least one. Whoever takes the last coin wins.
You go first. The machine never makes a mistake. If a winning move exists from the position you hand it, it will find it. The only way to win is to give it a position where every possible move leads to your advantage. Those positions have a name: they are the losing positions, and they are the key to the whole game.
What a losing position looks like
A position is losing for whoever has to move if every available move from it hands the other player a winning position. The simplest losing position is zero and zero. Whoever faces two empty piles has already lost because there are no coins left to take.
Working upwards from there, the losing positions are one and two, three and five, four and seven, six and ten, eight and thirteen, nine and fifteen, and so on. The order of the two piles does not matter. One and two is the same as two and one.
These pairs have a pattern. The first pair differs by one. The second pair differs by two. The third by three. The fourth by four. The k-th losing pair always differs by k. And every whole number appears in exactly one of these pairs, never two and never zero.
Where the golden ratio comes in
The golden ratio is the number 1.618 and a bit more, usually written with the Greek letter phi. It is irrational, meaning it cannot be expressed as a fraction of two whole numbers. It satisfies the equation where the square of phi equals phi plus one. It shows up in art, in plants, in spirals, in geometry, and, strangely, in this coin game.
Take the golden ratio and multiply it by one, two, three, four, and so on. Throw away the fractions each time. You get one, three, four, six, eight, nine. Those are the smaller halves of the losing pairs. Now do the same with the square of the golden ratio, which is 2.618 and a bit. You get two, five, seven, ten, thirteen, fifteen. Those are the larger halves.
Nothing in the rules mentions irrational numbers. The rule is just take from one pile or the same from both. Yet the answer is governed by a number that cannot be written as a fraction. This was published by Willem Wythoff in 1907 and it has surprised people ever since.
Controls and what you see
The two piles are shown as stacks of coins. To take from one pile, tap the coin you want to take down to. If a pile has eight coins and you tap the fifth from the bottom, you take three. The pile shrinks to five.
Below the piles, a row of numbered buttons lets you take the same number from both. If both piles have at least four coins, buttons for one, two, three, and four appear. Tapping the three button removes three from each pile at once.
The counters above the board show coins left, whose turn it is, and how many moves you have made. The machine responds after a short pause. A message under the board tells you what it did.
The three pile sizes
The Piles selector offers Small, Medium, and Large. Small draws from piles up to about twelve coins. Medium goes up to about eighteen. Large can reach twenty-six.
Larger piles mean more losing positions to keep track of. On small piles, you only need the first few pairs. On large piles, you might need to work out pairs like eleven and eighteen or fourteen and twenty-three. The arithmetic is always the same, but there is more of it.
Every starting position is chosen so that a winning move exists. The machine never puts you in a losing position at the start, so a loss always means a mistake somewhere in the middle.
How to find the right move
Look at the two pile sizes and find which losing pair you can reach. There is always exactly one from a winning position. Sometimes you take from the left pile, sometimes from the right, sometimes from both.
Say the piles are five and nine. The losing pairs you know are one and two, three and five, four and seven, six and ten. Can you reach any of them? Take four from the right pile and you get five and five. That is not a losing pair. Take four from both and you get one and five. Not a pair either. Take two from the right and you get five and seven. Not a pair. Take two from both and you get three and seven. Not a pair. Take four from the right to get five and five, then you realise the answer: take from the right to get five and three. Three and five is a losing pair. Hand that over.
With practice, you stop checking every option and start recognising the pairs by sight. The k-th pair differs by k, so the first thing to check is the gap between the two piles.
Equal piles are dangerous to give away
If both piles have the same number, whoever moves next can take them all from both piles in one move and win. Equal piles of any size are a winning position for the player about to move.
This means you should never hand the machine two piles of the same size. It will take the lot and the game is over. The only exception is zero and zero, but by then you have already lost. Even two and two, which looks safe, lets the machine take two from both and win instantly.
Watch for this when you are planning a move. If taking from one pile would leave both piles equal, find a different move.
Using the both option
Taking from both piles is what makes this game different from ordinary coin-taking puzzles. Without it, the game would split into two independent piles and the strategy would be completely different.
The both option is often the only way to reach a losing pair. If the piles are seven and twelve, the pair you want is four and seven. You need to remove three from the larger pile, which you can do by taking from the right pile alone. But if the piles are nine and fourteen, the pair you want is four and seven, and you need to remove five from each. Only the both option gets you there.
Do not ignore it. Players who only think about single-pile moves miss half the available positions.
Mistakes that hand the machine a win
- Leaving equal piles. The machine takes both at once and wins on the spot.
- Taking coins without checking which losing pair you are aiming for. Random moves feel active but they leave the machine a winning response almost every time.
- Forgetting to consider the both option. The losing pair might only be reachable by taking from both piles, not from one.
- Trying to memorise all losing pairs at once. Start with one and two, three and five, four and seven, six and ten. Those four pairs cover almost every small pile game. Add more as you move up in size.
- Assuming the machine will slip. It never does. It plays perfectly from a table of every position. Every loss is your mistake, not its luck.
- Rushing through moves without checking the gap. The k-th pair differs by k. If you see piles that differ by three, you know you are looking for the third pair, which is four and seven. Use the gap to narrow the search.
All the coins stay on your own device
The losing positions are computed right inside the page by working through every position from zero upwards. Nothing is sent to a server. There is no account, no login, and no data collection. Your best score is kept in your browser's local storage on this device only. The page works offline once loaded, because there was never anything on the other end to begin with.
