Roost

Birds have to be settled into boxes for the night, a roost being where they sleep. When it will not come out, the reason is always the same: some group of birds has fewer boxes between them than there are birds.

How to play

Under each bird's name is the list of boxes it will accept, and no box will take more than one bird.

  1. Start with the fussy birds A bird accepting only two boxes has far fewer options than one accepting four. Place those first.
  2. Look for a shared box If two birds both accept only the same two boxes, those two boxes belong to them and nobody else can have either.
  3. Bump when you must Putting a bird in an occupied box turns the other one out. Sometimes that is exactly the move.
Full instructions

In depth

Every bird needs a box, no box takes two, and one theorem proves it works

How the matching puzzle works, why fussy birds should be placed first, what the spare box really means, and the counting trick that tells you whether a group of birds can ever be housed.

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

What the game asks you to do

A set of birds appears at the top of the screen. A row of boxes sits below them. Each bird has a list of boxes it will accept, shown as numbers under its name. No box can hold more than one bird. Your job is to place every bird into a box it will accept, with no two birds sharing the same box.

There is always one more box than there are birds. Exactly one box will be left empty when you finish. Every puzzle is generated from a real arrangement and verified to be solvable before it is shown to you. Multiple solutions often exist, and any valid arrangement counts as a win.

Controls and interface

Tap a bird to select it. The boxes it will accept are outlined in green. Tap one of those boxes to place the bird there. If you tap a box the bird does not accept, a message tells you it will not take that box.

If you place a bird in a box that already holds another bird, the sitting bird is turned out and you will need to find it a new home. Tap a bird that is already settled to remove it from its box. Every placement and every removal counts as one move.

The game tracks your move count. You can place and displace birds as many times as you need. There is no move limit or timer. The puzzle is solved the moment every bird has a box.

Three puzzle sizes

A dropdown next to the game lets you choose between Small, Medium, and Large. Small gives you four birds and five boxes. Medium gives you five birds and six boxes. Large gives you six birds and seven boxes.

The number of boxes each bird accepts varies, but every puzzle is checked to make sure that no bird accepts all the boxes and no bird accepts fewer than two. This means every bird has a real choice to make, and no bird is trivially easy to place.

Larger puzzles are harder because the number of possible arrangements grows quickly. With six birds and seven boxes, there are many more combinations to consider, and the constraints interlock in ways that are not obvious at first glance. Changing the size starts a new puzzle with fresh birds and fresh acceptance lists.

Start with the fussy birds

A bird that accepts only two boxes has exactly two places it can go. A bird that accepts four boxes has much more flexibility. Always place the most restricted birds first. Their limited options constrain the rest of the puzzle and narrow your choices in a helpful way.

After the fussy birds are seated, look at what remains. The flexible birds now have fewer open boxes to choose from, and the right placement often becomes obvious. If you place the flexible birds first, you risk taking a box that a fussy bird needed, which forces a chain of displacements later.

Scanning the acceptance lists before you make any move is time well spent. Find the bird with the fewest accepted boxes. If two birds are tied, look at which boxes they share. That overlap is where the real constraint lives.

The counting trick that reveals dead ends

Take any group of birds and count all the boxes that group will accept between them. If the number of boxes is smaller than the number of birds in the group, those birds cannot all be housed. There are simply not enough places to go around.

This counting works for any size of group. Two birds that both accept only the same two boxes are fine because two birds and two boxes match. But if three birds between them only accept two boxes, something has to give. One of those three birds must be placed elsewhere.

The remarkable fact is that this counting is the only test that matters. If no group of birds anywhere in the puzzle fails the count, a complete arrangement is guaranteed to exist. This is a result from mathematics proved in 1935. Every puzzle here passes the test, so every puzzle has at least one solution.

Recognising locked groups

When two birds accept exactly the same two boxes and nothing else, those two boxes are reserved for them. No other bird can use either box, even if its acceptance list includes one of them. This locked pair removes two boxes from consideration for everyone else.

The same principle works for groups of three. If three birds between them accept exactly three boxes, those boxes belong to the group. Every other bird must look elsewhere. Spotting these locked groups early simplifies the rest of the puzzle because it reduces the number of options for the remaining birds.

On Small puzzles, locked pairs are usually obvious. On Large puzzles, you may have a locked triple that is harder to see because the three birds do not accept identical lists. They just happen to cover exactly three boxes between them. Look for birds whose acceptance lists overlap heavily. When three lists share three boxes, those boxes are spoken for.

The spare box is not a free pass

Having one extra box does not mean the puzzle is easy. The spare box only helps a bird that actually accepts it. If no remaining bird will take the spare, it sits empty and contributes nothing.

Working out which box will end up empty is often the real puzzle. Sometimes the spare is obvious because no bird wants it. Other times, every box is wanted by at least one bird, and the spare is whichever box the arrangement does not need.

Do not assume the spare will be the last box you fill. Sometimes the right move is to deliberately leave a popular box empty because the bird that wants it can take another box instead, freeing up space for a fussier bird. Figuring out which box ends up empty often unlocks the rest of the puzzle.

When to bump a settled bird

Placing a bird in a box that already holds another bird turns the sitting bird out. This displacement costs a move, but it is sometimes the fastest way to fix a stuck arrangement.

If you realise that a settled bird is sitting in the only box a new bird will accept, bumping the old bird is the correct play. The old bird probably has other options and can be reseated elsewhere. Fighting to keep every bird where it first landed leads to longer detours than a single bump.

Deliberate bumping is especially useful on Large puzzles. You might seat four birds cleanly and then find the fifth bird has no open boxes left. Bumping one of the first four opens a space, and the displaced bird finds a home in a box that was not useful before.

Common mistakes that add moves

  • Placing the flexible birds first and leaving the fussy ones with no options.
  • Ignoring shared boxes. Two birds that both need the same box cannot both have it.
  • Refusing to bump a settled bird when displacement would solve the puzzle in one step.
  • Overlooking a locked pair. If two birds share only two boxes, those boxes are spoken for.
  • Trying every combination blindly instead of reading the acceptance lists for constraints.

Scoring

The game counts your moves. Every placement, removal, and displacement adds one to the total. Fewer moves mean a more efficient solution. The result screen reports your move count and the number of birds you housed.

Your best result is saved in your browser on this device. It is never sent to a server and does not follow you to another machine or browser. Lower move counts replace higher ones.

No data leaves your device

The birds, the boxes, the matching logic and the puzzle generator all run inside your browser. Nothing is uploaded, there is no account to create, and once the page has loaded the game works without an internet connection. Your best score is stored in your browser's local storage on your own device. You can verify this by loading the page and then disconnecting from the network.

Help

How to play Roost

Under each bird's name is the list of boxes it will accept, and no box will take more than one bird. Select a bird and the boxes open to it are outlined in green, so the legal moves are always in front of you; tap a settled bird to turn it out again. The puzzle is done when every bird has a home.

Start with the fussy birds

A bird accepting only two boxes has far fewer options than one accepting four. Place those first.

Look for a shared box

If two birds both accept only the same two boxes, those two boxes belong to them and nobody else can have either.

Bump when you must

Putting a bird in an occupied box turns the other one out. Sometimes that is exactly the move.

Fill every box that must be filled

There is one spare box, so exactly one stays empty — working out which is often the puzzle.

Hall’s marriage theorem

There is an exact answer to when a puzzle like this can be solved, and it is a lovely one. Take every possible group of birds and count the boxes that group accepts between them. If some group ever accepts fewer boxes than there are birds in it, no arrangement can possibly work — that much is obvious. What is not obvious is the converse: if no group anywhere fails that count, an arrangement always exists. That is Hall’s marriage theorem, proved in 1935. Every roost here is built from a real arrangement, then checked twice over — once by actually finding a matching, and once by testing Hall’s condition on every group — so it is always solvable.

Good to know

Count a group and its boxes

Take any set of birds and count the boxes they accept between them. If the boxes ever number fewer than the birds, that group cannot all be housed.

Three birds, three boxes

When three birds between them accept exactly three boxes, those boxes are spoken for and every other bird must look elsewhere.

The spare box is a red herring

It does not help any bird that does not accept it. Having one spare does not mean anybody is comfortable.

Work by elimination

When a box is accepted by only one bird, that bird either takes it or it stays empty. Either way, you have learned something.

Common questions

Can two birds share a box?
Never. That is the whole constraint.
Do all the boxes get used?
No, there is one more box than there are birds, so exactly one is left empty.
What happens if I put a bird in an occupied box?
The bird already there is turned out and you will have to find it somewhere else.
Is every roost solvable?
Yes. Each one is generated from a real arrangement and verified before you see it.
Is there only one answer?
Usually not — several arrangements often work, and any of them counts.