Griddle

A grid to be tidied two ways at once: each tile in the right place, and each tile the right way round. Fixing the order spoils a face and fixing a face spoils the order, so the solved grid is the one where neither is wrong.

How to play

Tapping a pancake slides the spatula underneath it and turns over everything above in one go, which reverses their order and shows the other side of each.

  1. Work from the bottom up Get the biggest pancake to the bottom first and leave it there. Then the next biggest, and so on.
  2. Bring it to the top, then flip it down The standard move is two flips: one to bring the pancake you want to the top, one to send it where it belongs.
  3. Mind which way up it lands Those two flips turn it over twice, so it lands the same way up it started. If that is wrong, you need a third.
Full instructions

In depth

Sorting burnt pancakes with nothing but a spatula

What the burnt pancake problem actually is, why every flip that fixes the order spoils a face, how to think two flips ahead, and the strategy that gets you close to the fewest flips the puzzle allows.

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

The setup and the goal

A stack of pancakes sits on a plate. Every pancake is a different size. Every one has a dark edge on one side, the burnt side. They start jumbled in random order with some burnt sides showing.

Your goal is to sort them by size, largest at the bottom and smallest on top, with every burnt side hidden underneath. The only tool you have is a spatula. Tap a pancake and the spatula slides under it, flipping everything above that point. That single operation is all you get.

What a flip actually does

A flip reverses the order of everything on top of the spatula and turns each pancake over. If you flip at the third pancake from the top, the top three pancakes reverse their positions and each one switches from burnt-side-up to burnt-side-down, or the other way around.

This double action is what makes the puzzle hard. You cannot sort without reversing, and you cannot reverse without flipping faces. A flip that puts a pancake in the right place might leave its burnt side showing. A flip that hides a burnt side might scramble the order you just fixed.

Tapping the very top pancake flips just that one. It stays in place but turns over. This is how you fix a single burnt side that is facing the wrong way. It costs one move, and it is often the right thing to do when everything else is already sorted.

The three stack sizes

Small gives you four pancakes. The puzzles are gentle and most can be solved in five or six flips. This is the place to learn the basic two-flip move without running out of time.

Medium uses five pancakes. The fewest flips needed is usually five or more, and the extra pancake makes it harder to keep track of faces while sorting. Most of the real difficulty lives here.

Large stacks six pancakes. The search space is much bigger, and the fewest flips can be surprisingly high. Six or seven is common. You have a few extra flips beyond the minimum before the griddle goes cold, but not many. On large stacks, planning every flip before you start tapping is worth the time it takes.

The two-flip move that solves everything

The basic technique is two flips. First, find the biggest unsettled pancake. Flip at that pancake to bring it to the top of the stack. Then flip the entire stack to send it to the bottom. Now the biggest is in place. Repeat for the next biggest.

This works for sorting the sizes. The problem is that each of those two flips also turns the pancake over twice. Twice means it lands the same way up it started. If it started with its burnt side down, good. If it started with its burnt side up, it still has its burnt side up after two flips. You solved the position but not the face.

When the face is wrong after two flips, you need a third: bring the pancake to the top and flip it alone. That fixes the face but now the pancake you just moved is on top instead of at the bottom. So you flip the whole stack again to put it back. That is four flips for one pancake instead of two, and it is exactly why the fewest-flips number is often higher than you expect.

Working from the bottom up

Always settle the bottom of the stack first. Once the biggest pancake is in the right place with its burnt side down, leave it there. Everything you do after that should only flip above it.

Then settle the second biggest, then the third, and so on. Each settled pancake shrinks the problem by one. By the time you reach the top two, the stack is small enough that you can usually see the answer without thinking hard.

If you try to fix the top first and work downward, the bottom pancakes keep getting shuffled by your flips. The whole stack stays messy and you run out of moves. Bottom up is the only reliable order.

Watching the settled count and the par

The scoreboard shows three numbers. Settled tells you how many pancakes at the bottom are in place with their burnt side hidden and will not move again. Flips left is your budget. Fewest flips is the par for this particular puzzle.

The par comes from a full search of every possible sequence of flips from the starting arrangement. It is not a guess or an estimate. It is the actual minimum. Matching it is hard. Getting within one or two of it is a good result.

When flips left reaches zero and the stack is not solved, the griddle has gone cold and the game ends. The message tells you what the par was, so you can see how far off you were.

Why two touching pancakes save a flip

If two pancakes that belong next to each other are already touching and in the right order relative to each other, you can move them as a pair. Flip them both to the top, then flip them both down together. They stay together through the whole process, saving the flips you would have spent handling them one at a time.

Look for these pairs before you start. A stack that looks random might have two or three pancakes already in a useful relationship. Moving them as a unit is the difference between finishing under par and running out of flips.

Here is an example. Suppose the medium stack reads, from top to bottom, sizes 3, 2, 5, 1, 4. The 1 and 2 are not touching, but the 3 is sitting on the 2 and they are in the wrong relative order. If you flip at the 3, the top two become 2 then 3, now in the right order. After that you can move them together as one block to their final positions. Spotting that kind of opportunity before flipping is what separates a five-flip solve from a nine-flip struggle.

Mistakes that cost extra flips

The most common waste is fixing a face too early. If a pancake still needs to move, flipping it to hide its burnt side is pointless because the next flip will expose it again. Only fix a face once the pancake is in its final position.

  • Sorting from the top down. It feels natural but it does not work. Every flip below undoes what you just did above.
  • Ignoring the par. If the par is six and you have used five flips with three pancakes still unsettled, you are not going to make it. Start over and try a different opening.
  • Flipping randomly. Each flip changes the order and the faces at the same time. Random flips compound the mess. Plan at least two flips ahead before you tap.
  • Forgetting that a single-pancake flip costs a move. Tapping the top pancake to fix its face is cheap, but it still counts. Budget for it.

A real research question behind the game

Sorting a stack by flipping prefixes is a genuine problem in computer science and mathematics. The question is: for a stack of n pancakes, what is the largest number of flips that any arrangement could ever need? Nobody has a general answer.

A 1979 paper by William Gates and Christos Papadimitriou gave the first good upper bound. It was Gates's only academic paper, written while he was still an undergraduate. The result stood for thirty years before it was improved.

The burnt version is harder because each pancake has two states instead of one. The game plays this harder version, and the par it shows for each puzzle is found by exhaustive search over both the ordering and the facing of every pancake.

Everything happens on your own machine

The puzzle, the search for the fewest flips, and your best score all run inside this page. No data is sent to any server. There is no account. Your best score sits in your browser's storage and stays there until you clear it. You can disconnect from the internet after loading the page and every feature still works, because the game never needed a connection to play.

Help

How to play Griddle

Tapping a pancake slides the spatula underneath it and turns over everything above in one go, which reverses their order and shows the other side of each. A burnt side you had hidden comes straight back up. You are finished when the stack runs largest at the bottom to smallest at the top with not one burnt side showing.

Work from the bottom up

Get the biggest pancake to the bottom first and leave it there. Then the next biggest, and so on.

Bring it to the top, then flip it down

The standard move is two flips: one to bring the pancake you want to the top, one to send it where it belongs.

Mind which way up it lands

Those two flips turn it over twice, so it lands the same way up it started. If that is wrong, you need a third.

Count the flips

The fewest possible is at the top. Careless sorting runs out of griddle time.

The pancake problem, and the one paper Bill Gates wrote

Sorting a stack by repeatedly flipping some number off the top is a genuine research question. How many flips can a stack of n pancakes possibly need? Nobody knows in general. The first good bound came in a 1979 paper by William Gates and Christos Papadimitriou — the only academic paper Gates ever published, written while he was an undergraduate — and it stood for thirty years. The burnt version, where each pancake has a side that must end up underneath, is harder again, and it is what this game plays. Every stack here is searched exhaustively over the orders and faces together, so the fewest flips shown is a fact rather than a guess.

Good to know

A single flip fixes a lone burnt side

If only the top pancake is burnt side up, flipping just that one costs a single move.

Two pancakes already touching help

A pair that is already in the right order relative to each other can often be moved as one.

Reversing is not free

Every flip turns over everything it touches. There is no way to reorder without also reversing faces.

The last two are the fiddly ones

Sorting the sizes is usually easy. Getting the last faces down is what costs the extra flips.

Common questions

What does the dark edge mean?
It is the burnt side, and it is showing. All of them must be face down at the end.
Can I flip just one pancake?
Yes — tap the top one. It turns over on the spot.
Do I have to sort the sizes as well?
Yes. Largest at the bottom, smallest at the top, and every burnt side hidden.
Why is the number sometimes higher than the pancakes?
Because faces cost moves too. A stack already in the right order can still need several flips.
Is this a real maths problem?
Very much so. The general answer for the burnt version is still open.