Rank Sort

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

How do you sort a row of cards when the only move is to flip the front of the row?

Work from the largest card down, and never chase the small ones. Find the largest card that is not already on its finished slot, flip the stretch that ends on it so it lands at the front of the row, then flip the stretch that ends on the slot it belongs in. Two flips and that card is home, and because every later flip stops short of it, it stays home. Repeat with the next-largest, and the last two cards resolve themselves. That is at most two flips per card, and it always terminates — which is exactly why it is worth learning even though it is not always the shortest route. The shorter routes exist, but they need you to spot a stretch that is already in descending order and land several cards with one flip.

Flips 0 / 7In place 0 / 7Method costs 5Best possible 5

0 of 7 in place. 7 flips left. Largest unsorted card K at position 4, belongs at position 7. Cursor at position 7: flipping turns over the first 7 cards.

choose how many cards turn over · jump to the largest card out of place · jump to the slot it belongs in · Enter flip. Click the board first, or press Tab to focus it.

What this builds

SKILLrun the greedy pancake rule — largest card out of place to the front, then flip it into its slot — and see where a greedy rule costs more than it needs to

Sort the row when the only move is to flip the front

Seven cards lie face up in a row, out of order. There is exactly one move: choose a card and turn over everything from the left-hand end up to and including it, as a whole block, so that stretch comes back reversed. Keep flipping until the ranks run low to high from left to right. You cannot move a single card, you cannot swap two, and you cannot touch the right-hand end without dragging the left-hand end along with it — which is why this looks impossible for about thirty seconds and then becomes easy, all at once, the moment you see the method.

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. Choose how many cards turn over with Left and Right. The cursor sits on the last card the flip will reach, and every card that will turn over is marked with a dashed edge, so the extent of the move is visible before you commit to it.
  3. Find the ▲. That is the largest card still out of place — the one the method moves next. The line under the board names it and says which slot it belongs in.
  4. Bring it to the front with Up, which jumps the cursor straight to it, then Enter. It is now the leftmost card.
  5. Flip it home with Down, which jumps the cursor to the slot it belongs in, then Enter. That card is now on its finished slot and reads ✓ home; nothing you do afterwards disturbs it.
  6. Repeat on the next-largest. Two flips per card at worst, and the last two fall into place on their own.
  7. Win when all seven read in order. If the flip counter runs out first, the round ends.

The budget is what that method costs on this exact row, plus two — so following it always works. The score is what you save against it, which means the real game is finding the shorter line the method walks straight past.

FAQ

How do you sort a row of cards when the only move is to flip the front of the row?

Work from the largest card down, and never chase the small ones. Find the largest card that is not already on its finished slot, flip the stretch that ends on it so it lands at the front of the row, then flip the stretch that ends on the slot it belongs in. Two flips and that card is home, and because every later flip stops short of it, it stays home. Repeat with the next-largest, and the last two cards resolve themselves. That is at most two flips per card, and it always terminates — which is exactly why it is worth learning even though it is not always the shortest route. The shorter routes exist, but they need you to spot a stretch that is already in descending order and land several cards with one flip.

Is the shortest possible line always the same as the method's?

No, and the gap is the point. The status row shows both: Method costs is what the largest-first procedure spends on this row, and Best possible is the true minimum, found by an exhaustive search before the deal is handed to you. On a lot of rows they match. On many they do not, because the method throws away information — it only ever looks at the biggest card left, while a shorter line might reverse a run of three that happens to already be in descending order and place all three at once. Finishing in the true minimum pays a bonus, and it is the only thing in the game that cannot be reached by following instructions.

Is every row actually sortable inside the budget?

Yes, by construction. Each row is built by starting from the seven cards in order and applying five prefix flips at random. A prefix flip is its own inverse, so replaying those same five lengths in the opposite order puts the row back in order — a solution exists before you ever see the board. The budget is not that number, though: it is what the taught method costs on this specific row, plus two, which is exactly enough slack for one wrong flip and the identical flip that takes it back.

Do the suits mean anything?

No. Spades, hearts, diamonds and clubs are decoration, and nothing in the rules reads them — a 7 of clubs behaves identically to a 7 of hearts. They are printed because a rank with a suit reads as a card rather than as a number in a box. If you find yourself looking for a suit rule, there isn't one, and the screen reader deliberately does not announce them.

Why can I not flip just the first card?

Because turning over a stretch of one card leaves it exactly where it was. It would cost you a flip and change nothing, so the leftmost card is not a target and the game refuses it rather than charging you for it. It still turns over on every single flip you make — the front of the row always moves — which is why it carries the mark whatever the cursor is doing.

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

None, and there never will be. The cards are ranks on tiles: no currency, nothing to buy, no wager of any kind, and no gambling mechanic anywhere in the game. There is no score to buy your way up and no ad to watch.

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

Both. Left and Right set how many cards turn over, Up jumps to the largest card out of place, Down jumps to the slot it belongs in, and Enter flips. Every card announces its rank, whether it is already in place, and whether it is the largest one still out of place; the board announces how many cards are settled, how many flips are left, and exactly how many cards the next flip will turn over. Every state carries a glyph — ✓, ▲, ↺ — so nothing depends on telling one tint from another.

Does it work offline?

Yes. Once the page has loaded once, the whole game is on your device — the deal generator, both solvers, the rules, the copy. Nothing is fetched while you play, and no result leaves the device.

Limits

Seven cards, seven distinct ranks drawn from A to K, and one move: reverse a stretch that starts at the left-hand end. Rows are built from five random flips of the finished order, so the true minimum is never more than five and is usually four or five. The method's cost is measured on the dealt row rather than estimated, and the budget is that cost plus two. The exhaustive search that finds the true minimum is only affordable because seven cards have 5,040 arrangements; a longer row would need a different tool, and that is the reason the row is seven and not ten.

Related

Card Ladder is the other card game built on move order — same "the thing you bury first is the thing you need last" lesson, but there the constraint is rank adjacency rather than reversal. Colour Sort is the same shape of problem with stacks instead of a row. Slide Fifteen is the other puzzle where working in a fixed order beats chasing whatever looks most wrong.

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.