Stack Pops

Runs entirely on your device — works with the network off, no ads, no account, no tracking.

  • Works offline
  • Keyboard playable
  • Screen-reader playable
  • No ads, no account
  • No betting, no money, no prizes
  • 1–3 minAll ages

Which orders can you make from a shuffled row using only one spare pile?

Exactly the ones with no middle, high, low triple in them — read the ranks left to right as they were dealt, and if you can find three cards where a middling rank comes first, a higher rank comes after it, and a lower rank comes after that, the deal is impossible. Every other deal can be sorted. The reason is short. That low card has to reach the run before the other two. When it arrives, both of the others are still waiting, so both are on the pile — and the higher one went on later, so it is sitting on top of the middling one. The pile only opens at the top, so the higher one has to come out first. But its rank says it must come out last of the three. Nothing can satisfy both, so no sequence of presses exists. Computer scientists call the survivors the stack-sortable orders, and they are counted by the Catalan numbers: 429 of the 5 040 deals of seven cards.

Moves 0 / 13Left 13Shortest from here 10Run 0 / 7

The run wants 1 next. Front of the row 6. Top of the pile empty. 13 moves left, shortest from here 10.

The run — 0 of 7 laid, in rank order

  1. Place 1 wants the 1. This is the card the run wants next.
  2. Place 2 wants the 2. Still waiting.
  3. Place 3 wants the 3. Still waiting.
  4. Place 4 wants the 4. Still waiting.
  5. Place 5 wants the 5. Still waiting.
  6. Place 6 wants the 6. Still waiting.
  7. Place 7 wants the 7. Still waiting.

The pile — only the top card can move

  1. Empty — anything may be pushed onto it.

The row — 7 still to come, front first

  1. The 2 is 1 back in the row.
  2. The 1 is 2 back in the row.
  3. The 4 is 3 back in the row.
  4. The 3 is 4 back in the row.
  5. The 5 is 5 back in the row.
  6. The 7 is 6 back in the row.

The run wants the 1 next. The shortest finish from here is 10 presses, and you have 13 left.

Enter sends the front card straight into the run · pushes it onto the pile · pops the pile’s top card. Click the board first, or press Tab to focus it.

What this builds

DOMAINA stack is last-in first-out, and that alone fixes which orders it can ever produce — exactly the ones with no 231 pattern, counted by the Catalan numbers.

Sort seven cards into a run using one spare pile that only opens at the top

Seven cards arrive in a row, in whatever order the deal gave them. The run below wants them in rank order — 1, then 2, all the way to 7 — and you have exactly one place to put a card that is not wanted yet: the pile. The pile is a stack. Only the card on top can be taken, so the last card you push on is the first one you can pop off, and everything under it has to wait.

That single restriction is the whole game, and it is far sharper than it looks. Of the 5 040 ways seven cards can be dealt, only 429 can be sorted this way at all. The rest jam, always, no matter how well you play — which is why this board never deals one of them. Each deal here is built backwards from the finished run, so a winning line exists before you press anything, and the number of moves you are given is that line's own length plus three.

There are three presses. A card can be sent straight into the run when the run is already waiting for it, pushed onto the pile when it is not, or popped off the pile when its turn comes. The board shows the fewest presses that still finish from exactly where you are standing, so you find out on the press that caused it whether you have just taken a longer route — or ruined the deal.

It runs entirely on your device: 0 network requests, works offline. No ads, no account, nothing to buy, and no betting, money or prizes of any kind.

How to play

  1. Focus the board — click it, or press Tab until it is focused.
  2. Read the run first. It fills from the left and it is strict: place 1 wants the card 1, place 2 wants 2, and so on. The place still open is marked, and the card it wants is printed in it, so you never have to remember what is next.
  3. Press Enter to send the front card straight into the run. This is the cheap move — one press instead of two — and it only works when the front card is exactly the one the run wants next.
  4. Press the up arrow to push the front card onto the pile. Use it when the card at the front is needed later. It always works, which is precisely the danger.
  5. Press the down arrow to pop the pile's top card into the run. Like sending, it only works when that card is the one wanted next. The F key and either shift key do the same thing.
  6. Never push a higher card on top of a lower one. The lower one can then never come out first, the run can no longer be finished, and the round ends there and names the pair. The board warns you before the press: the push control says which card it would bury.
  7. Watch "shortest from here". It is the fewest presses that still finish the deal from your exact position. A good press drops it by one. If it holds still, you spent a press for nothing.
  8. Every press of Enter, up or down costs one move, including one the board refuses. You are given the shortest line plus three, so there is room for a fumble and not for a shuffle.

You can play entirely by pointer instead: click the front card of the row to send it, click the pile to pop from it, and click the push control to push.

FAQ

Which orders can you make from a shuffled row using only one spare pile?

Exactly the ones with no middle, high, low triple in them — read the ranks left to right as they were dealt, and if you can find three cards where a middling rank comes first, a higher rank comes after it, and a lower rank comes after that, the deal is impossible. Every other deal can be sorted. The reason is short. That low card has to reach the run before the other two. When it arrives, both of the others are still waiting, so both are on the pile — and the higher one went on later, so it is sitting on top of the middling one. The pile only opens at the top, so the higher one has to come out first. But its rank says it must come out last of the three. Nothing can satisfy both, so no sequence of presses exists. Computer scientists call the survivors the stack-sortable orders, and they are counted by the Catalan numbers: 429 of the 5 040 deals of seven cards.

What is the "231 pattern" and why does it break the pile?

It is the same middle-high-low triple, written the way the textbooks write it: number the three cards 2, 3, 1 in the order they arrive, and that shape is the one obstruction. It is worth knowing because it is the only one — a deal with no such triple always works, and a deal with even one never does. The practical version at the board is simpler still: the pile has to stay in descending order from the bottom up. Every push either keeps it that way or ends the round, and you can see which before you press.

Is every deal actually possible?

Yes, and it is guaranteed by how the deal is made rather than checked afterwards. The generator starts from the finished position — the run holding 1 to 7, the pile and the row empty — and runs the rules backwards: lifting the last card off the run back onto the pile, and returning the pile's top card to the front of the row. Every backwards step is the exact reverse of a legal press, so reading the list forwards gives a complete winning line before the cards are ever shown to you. Because around eleven of every twelve random deals are impossible, drawing one and testing it would have been the wrong way round.

When should I send a card straight through instead of pushing it?

Always, whenever the run is already waiting for it — sending costs one press and pushing then popping the same card costs two, and they end in the identical position. That is why the move budget is different on every deal: it is seven presses for the cards that never need the pile, plus two for each one that does, plus three spare. A deal where most cards arrive close to their turn is short and cheap; a tangled one is long and dear, and the board tells you which you have before you start.

Is there any money, betting or in-app purchase in this?

None, and there never will be. No currency, nothing to buy, no hints to unlock for a fee, no prizes.

Does it work offline?

Yes. Once the page has loaded once, everything is on your device — the generator that builds the deal backwards, the solver that sets the budget, and the same solver again recounting the shortest route after every press. No server is involved in play at any point.

Can I play it with a keyboard or a screen reader?

Both, fully. Enter sends, the up arrow pushes, the down arrow pops, and the W, S, E and F keys mirror them for a one-handed grip. Every card announces its rank; every place in the run announces the rank it is waiting for and whether it is filled; every card on the pile announces whether it is on top or buried under another. Nothing on the board is carried by colour alone — the front card, the top of the pile and the open place in the run each carry a symbol and a word as well as a tint, and the warning before a burying push is written out in full.

Limits

Seven cards, always, ranked 1 to 7 in one suit — enough that the pile matters and few enough that the whole board is readable at a glance. The generator only keeps deals needing between three and five pushes with at least six changes of operation, so "push everything then pop everything" is never the answer, and neither is "send everything". The budget is the shortest line plus three. There is no timer, no undo, and no hint button: the warning on the push control and the live shortest-route count are the whole safety net, and both are shown rather than hidden behind something you have to ask for. A buried card ends the round immediately — the deal really is over at that point, and letting you carry on pressing would only postpone the same answer.

Related

Stack Order is the other puzzle here built on the rule that only the top of a pile can move, and Card Ladder is the other one where the deal is generated backwards from a finished position so no board is ever a dead end. Rank Sort is the ordering puzzle for a whole hand at once, Domino Line is the one about what can legally follow what, and Water Jugs is the other game where a solver checks the board before you are allowed to see it.

Bookmark this page (Ctrl+D, or ⌘D on Mac) or install the app — it works offline the next time you need it.

Have a question or feedback about this game?

Private: this note isn't tracked, and nothing you did in this game is sent — only what you type here.