Zriddle logo

How to make a zebra puzzle

Play today's puzzle

A puzzle board being filled in with jigsaw piece tiles, beside a pencil tile and a light bulb tile

To make a zebra puzzle, write the answer first: a small grid saying which item goes in which place. Then write true clues about that grid, one at a time, until only one arrangement fits them all. Finally, take out any clue the puzzle does not need, and solve it once more from the clues alone to check there is exactly one answer.

This is the same method our own generator uses to make every daily Zriddle puzzle, just done by hand. It works for a classroom starter with three children and three pets, or a five-house puzzle in the style of Einstein's riddle. If you only want a puzzle right now, the zebra puzzle generator makes one in a tap.

The steps

  1. Choose a setting and categories. Pick a row of places (houses, stools at a cafe, lockers, kennels) and two to four categories, such as name, drink and food. Every category needs the same number of items as there are places. For a first puzzle, use 3 places and 3 categories.
  2. Write the answer grid first. Decide where everything goes and write it down as a table, one column per place. This is your secret answer. Every clue you write must be true for this grid.
  3. Brainstorm true clues. Look at the grid and list facts about it. Mix the kinds: "X is in place 1" (fixed), "X is with Y" (link), "X is not with Y", "X is directly left of Y", "X is next to Y", "X is at one of the ends", "X is somewhere left of Y". The clue types guide has twelve kinds to choose from.
  4. Add clues one at a time. Start with a clue that gives the solver a way in, often a fixed or end clue. After each new clue, ask: does this rule anything out that the earlier clues did not? If it does not, leave it out.
  5. Test that there is exactly one answer. Solve the puzzle from the clues alone, without looking at your answer. If you get stuck with two possible arrangements, add a clue that tells them apart. If you reach a different answer from yours, one of your clues is wrong or unclear.
  6. Remove clues you do not need. Try covering each clue in turn. If the puzzle still has only one answer without it, you can cut it, or keep it as a deliberate bit of extra help for younger solvers.
  7. Grade it and play-test it. Note which kinds of reasoning your solve needed (see the difficulty table below), then give it to someone else. Reword any clue they misread.

Worked example: building a 3 by 3 puzzle by hand

Here is one puzzle built with the steps above, with every count checked by our solver.

Steps 1 and 2: the setting and the answer. Three people sit on stools 1 to 3 at a cafe counter. The categories are name (Ava, Bruno, Chloe), drink (☕ latte, 🍵 matcha, 🥤 smoothie) and food (🥐 croissant, 🧇 waffle, 🧁 muffin). This is the answer we chose:

The secret answer, written first
Stool 1Stool 2Stool 3
NameCAB
Drink🍵🥤☕
Food🧇🥐🧁

With no clues at all, three categories of three items can be arranged in 216 ways (6 orders for each category, and 6 × 6 × 6 = 216). Each clue should cut that number down.

Steps 3 to 5: adding clues and counting what is left. We added true clues one at a time and, after each, had the solver count how many arrangements still fit.

Clue addedArrangements left
1. Chloe is on stool 1.72
2. Bruno is eating the muffin.24
3. The matcha drinker is eating the waffle.8
4. The smoothie drinker is directly left of the latte drinker.3
5. Chloe is not drinking smoothie.2
6. Ava is next to Chloe.1

After clue 5, two answers were still possible. Both had Chloe on stool 1 with matcha and the waffle, and the smoothie on stool 2. The difference was whether Ava or Bruno sat on stool 2 (Bruno, with his muffin, takes the other stool). So the next clue had to tell Ava and Bruno apart. "Ava is next to Chloe" does exactly that, and leaves one answer.

Step 6: removing a clue. Now we covered each clue in turn and counted again. Without clue 5, there was still exactly one answer, because the other five clues already pin everything down. Every other clue was needed: take any one of them away and three or four answers fit. So clue 5 goes, and the finished puzzle has five clues:

  1. Chloe is on stool 1.
  2. Bruno is eating the muffin.
  3. The matcha drinker is eating the waffle.
  4. The smoothie drinker is directly left of the latte drinker.
  5. Ava is next to Chloe.

Step 7: solving it from the clues. Chloe is on stool 1 (clue 1), so Ava, who is next to her, is on stool 2 (clue 5), and Bruno is on stool 3 with the muffin (clue 2). Clue 4 means the latte is not on stool 1 and the smoothie is not on stool 3. The matcha goes with the waffle (clue 3), and the waffle cannot be on stool 3 where the muffin is, so the matcha is not on stool 3 either. That leaves only the latte for stool 3, so the smoothie is on stool 2 (clue 4), the matcha on stool 1, the waffle on stool 1 and the croissant on stool 2. It matches the answer grid, and it never needed a guess. It is smaller than a daily Easy puzzle, but it uses the same Easy-level reasoning.

Play today's puzzle

How our generator makes puzzles

Every daily Zriddle puzzle is made by a program that follows the same steps:

  1. Deal an answer. It picks a theme and shuffles the items into places at random. That shuffle is the answer.
  2. List every true clue. It writes out every clue of the allowed kinds that is true for that answer. Harder levels allow more kinds, such as "between" and "either, or" clues.
  3. Add clues until a person could finish. It draws clues at random and keeps one only if it lets a solver that reasons like a person cross something off. It stops when that solver can fill the whole grid.
  4. Strip out what is not needed. It tries removing each clue. If the puzzle can still be solved without it, the clue goes. Easy puzzles keep two of these spare clues on purpose, to be gentler.
  5. Grade it. The solver checks what kind of reasoning the puzzle needs. If that does not match the level, the program deals a new answer and starts again, up to 60 times, and keeps the closest match.
  6. Confirm one answer with a separate search. A separate search, which does not try to reason like a person, works through the possible arrangements and must find exactly one that fits. Only then is the puzzle used.

The step a person most often skips is the last one. Solving your own puzzle is a weak test, because you already know the answer and tend to read clues the way you meant them. If you write a puzzle by hand, type it into the zebra puzzle solver: it counts the answers that fit your clues, tells you if there are none or more than one, and says what kind of reasoning it needs.

How to grade the difficulty

Size matters, but the kind of reasoning matters more. These are the levels our solver uses, matched to the daily puzzles:

LevelSizeReasoning needed
Easy4 places, 3 categoriesRead each clue against the grid and spot items with one place left. A couple of spare clues help.
Medium5 by 4The same reasoning with no spare clues and more clue kinds, such as "between".
Hard5 by 5Pair reasoning: two items that can only go in the same two places block them for everything else.
Expert6 by 5No clue fixes an item to a numbered place, and a step may need a "what if" test.

To make your own puzzle easier, add a fixed clue or keep a spare clue. To make it harder, swap fixed clues for relative ones ("somewhere left of", "between"), and remove spare clues. For young children, 3 by 3 with one fixed clue and plenty of "is with" links works well. Our kids' printables and teacher printables show what that looks like on paper.

Common mistakes when writing clues

  • Unclear "left of". Say "directly left of" or "somewhere left of". Readers will take a bare "left of" either way.
  • Two answers. The most common fault in hand-made puzzles. Count the answers, do not just solve it once.
  • Giving it away. If the first two clues place half the grid, the rest feels like filling in a form.

Want to see finished puzzles solved one step at a time? Read the zebra puzzle examples.

Questions about making zebra puzzles

How many clues does a zebra puzzle need?

It depends on the size and the kind of clues. Our 3 by 3 example needed five. The classic five-house Einstein riddle has 14 or 15. Fixed and "is with" clues do more work each, so a puzzle full of them needs fewer.

How do I check my puzzle has only one answer?

Ask someone else to solve it, and also enter it into the zebra puzzle solver, which counts every arrangement that fits. You want exactly one.

Should I write the clues or the answer first?

The answer. Writing clues first and hoping they lead somewhere often ends with no answer or several. With the answer fixed, every clue you write is true by design.

Related guides

All of them are listed on the guides page.

Play today's puzzle