Sheaf

Stalks are tied into bundles and then rebuilt, pile by pile. Whatever you start from, they always settle into the same staircase - one, two, three and upwards - so the only thing in your hands is how long the journey takes.

How to play

The whole pack goes into piles of your own choosing before anything is played, and a pile you are unhappy with can be tapped to pick it back up.

  1. Notice you have no say in the play Once the cards are dealt the rule is forced. Everything you control happens before you press play.
  2. Avoid anything staircase-shaped Deal it close to a staircase and it arrives almost at once. You want to start as far away as you can.
  3. Try one huge pile It is a natural guess and often a good one, but it is not always the longest. Try a few shapes.
Full instructions

In depth

How to play Sheaf and find the longest deal

Sheaf is a puzzle built on a piece of mathematics called Bulgarian solitaire. You deal a set of cards into piles however you like, and then a fixed rule takes over: one card is removed from every pile and those cards form a new pile. This happens over and over, with no choices at all, until the piles settle into a staircase pattern and stay there forever. Every possible arrangement reaches the same destination, which is the remarkable part. Your only job is to arrange the cards so that the journey takes as many rounds as possible. This guide explains the rule, the controls, and the thinking that helps you find the longest path to the staircase.

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

The rule behind the puzzle

The process works like this. You start with a fixed number of cards divided into piles. On each round, one card is taken from the top of every pile. Those removed cards are gathered together and placed down as a brand new pile. Any pile that has been reduced to zero disappears. Then the round repeats.

When the total number of cards is a triangular number, meaning it equals 1 plus 2 plus 3 and so on, the piles always settle into a staircase: one pile of one, one pile of two, one pile of three, continuing up to the highest step. Once the staircase forms, the rule reproduces it exactly on the next round, so it stays forever. This is true regardless of how you arranged the cards at the start. The only question is how many rounds the settling takes.

Controls and interface

The board shows your cards in hand at the top and the piles you have built below. Press the Add a card button to place one card from your hand into the pile currently being built. Press Close the pile button to seal that pile and begin a new one. When all cards are dealt, press Play it out to watch the rule run. The board animates each round and reports how many rounds it took to reach the staircase.

Tap any finished pile to pick it back up, returning its cards to your hand so you can try a different arrangement. The game tracks how many attempts you have made and shows the longest possible run for the current pack size. When you match that target, the game is won.

The three pack sizes

The Pack selector offers Small, Medium, and Large. Small uses ten cards, which is the fourth triangular number and produces a staircase of one, two, three, and four. Medium uses fifteen cards and settles into a staircase of one through five. Large uses twenty-one cards and settles into one through six. The larger the pack, the more possible arrangements exist and the harder it becomes to find the longest path.

On the Small pack, the number of distinct ways to partition ten cards into piles is fairly modest, and you can try many arrangements in a short time. On the Large pack, the partitions number in the hundreds, and the optimal deal is not obvious at all. The game checks every single partition to find the true maximum, so the target it displays is guaranteed to be correct.

Strategy: what makes a deal last

Arrangements that are close to the staircase in shape settle almost immediately, because they are already near the destination. One pile of three, one pile of two, and one pile of five reach a staircase of one through four within a couple of rounds. To get a long run, you want to start as far from the staircase as you can.

A natural first guess is to put all cards into one big pile. This often produces a long run, because a single tall pile is about as different from a staircase as you can get. The rule shaves one card off it each round and creates a new pile of one, then shaves again and creates a pile of one alongside the pile from last round, slowly building the staircase from the bottom. But one big pile is not always the answer. Certain two-pile or three-pile arrangements can produce runs that are just as long or longer, because the interaction between the piles creates a longer transient before the system locks into its final shape.

Strategy: patterns to try

Equal piles tend to collapse quickly. If you deal ten cards as two piles of five, the first round takes one from each and creates a pile of two, leaving two piles of four and one pile of two. The symmetry breaks fast, and within a few rounds the staircase appears. Uneven splits are generally better.

Try putting most of the cards into one pile and one or two cards into a second pile. The small pile acts as a catalyst that changes how the rule chews through the big pile. Experiment with where you put the leftover cards. Sometimes a split like seven and three produces a longer run than a single pile of ten, and sometimes it does not. The only way to know is to try it, which is what makes the puzzle engaging.

Understanding the mathematics

Bulgarian solitaire was popularized by Martin Gardner in 1983 after it circulated among mathematicians in Bulgaria. The core theorem says that for any triangular number of cards, every starting partition reaches the staircase and stays there. The maximum number of rounds is bounded above by the number of steps in the staircase squared, minus that number. For a staircase of four steps, that bound is twelve, and for five steps it is twenty.

The puzzle does not require you to know this mathematics. But understanding that the destination is always the same, and that it is guaranteed to be reached, makes the puzzle feel less like guessing and more like searching a space with a definite answer. You are not hoping the staircase will form. It always does. You are only trying to delay it.

Common mistakes to avoid

The most common mistake is not dealing all the cards. The Play it out button only works when every card has been assigned to a pile. If you have cards left in hand, the board will not run the process. The count at the top of the screen shows how many are still undealt.

Another mistake is forgetting that you can pick up a pile and try again. Many players treat their first arrangement as final. The game is built around experimentation. Your score is the number of attempts it takes to find the maximum, so there is no penalty for trying a few bad deals on the way to the right one.

A third error is dismissing arrangements with many small piles. While equal piles of the same size settle fast, unequal collections of small piles can produce surprisingly long runs. Do not assume that a deal has to involve one large pile to be competitive.

Scoring and winning

The game scores you by the number of deals it took to find the maximum. A lower number is better, because it means you found the longest arrangement in fewer attempts. The game shows your best score alongside the current attempt count so you can track your progress across multiple games.

Winning happens the moment your deal matches the longest possible run. The board announces the result and counts that game as a win. You can then start a new game at the same size or switch to a larger pack for a harder challenge. The puzzle rewards methodical exploration rather than lucky guessing. Players who try a range of shapes and pay attention to how many rounds each one produces will build an intuition for which arrangements stall the process. Over several attempts, you start to notice which pile sizes interact in ways that resist the staircase, and that pattern recognition is what makes finding the answer on fewer tries satisfying.

Privacy and how the game runs

The entire puzzle runs inside your browser. No arrangements are sent to a server, no data leaves your device, and there is no account to create. Your best score is saved in local storage on this device only and will not follow you to a different machine. Once the page has finished loading, you can disconnect from the internet and the puzzle will continue to work without any change.

Help

How to play Sheaf

The whole pack goes into piles of your own choosing before anything is played, and a pile you are unhappy with can be tapped to pick it back up. Then it runs on its own: one card is lifted from every pile and set down as a new pile, again and again, and your score is how many rounds pass before the staircase appears.

Notice you have no say in the play

Once the cards are dealt the rule is forced. Everything you control happens before you press play.

Avoid anything staircase-shaped

Deal it close to a staircase and it arrives almost at once. You want to start as far away as you can.

Try one huge pile

It is a natural guess and often a good one, but it is not always the longest. Try a few shapes.

Watch what the rule does

Many equal piles collapse quickly; a few very uneven ones churn for a long time.

Bulgarian solitaire

Take a pack of cards, deal it into piles however you like, then repeatedly take one card from every pile and make those into a new pile. When the number of cards is a triangular number — 1, 3, 6, 10, 15, 21 and so on — the piles always end up as a staircase of 1, 2, 3 and upwards, and once there they never change again. Every starting arrangement whatever leads to the same place, which is startling for a process with no choices and no memory. Martin Gardner wrote about it in 1983 after it spread through the Bulgarian mathematical community, and the question of how long it can take was settled soon after: never more than the number of steps in the staircase, squared, less that number. This board tries every possible deal of the pack, so the target it sets is genuinely the longest.

Good to know

The destination never changes

One card, two cards, three cards and so on. Every possible deal ends there and stays.

The pack is a triangular number

Ten, fifteen or twenty-one cards — exactly enough for a staircase, which is what makes the result true.

Every card must be dealt

The board will not play out a partial deal. The count in hand is shown at the top.

You can try as often as you like

Only the number of attempts is scored, so experiment.

Common questions

Do I make any choices during the play?
None at all. The rule is completely forced, which is what makes the result surprising.
Why a triangular number of cards?
Because a staircase of 1, 2, 3 upwards uses exactly that many. Other totals settle into a loop instead.
Is one big pile always the longest?
Often but not always. Try a few shapes and see.
What if I deal fewer cards than the pack?
The board will not play it out. Everything must be dealt.
Is the target really the longest?
Yes. Every way of dealing the pack is tried.