Skip to content
All posts

Crack the secret code with pencil and paper: a right-place, wrong-place logic game for ages 7–12

A sheet of white grid paper standing at a slight tilt, its top row hidden under a gray card with a folded corner. Below a ruled line are four rows of three colored dots each, with black and white hint dots in a column on the right. A yellow pencil stands next to the sheet.

All you need is a sheet of paper, a pencil and a few colored pencils. One player makes up a secret code and hides it; the other player guesses. After each guess, the code keeper doesn't say "right" or "wrong". They only give a hint: how many parts are correct and in the right place, and how many are correct but in the wrong place.

It is a great game for waiting at a restaurant, a long car ride or a rainy afternoon. To find the code in as few guesses as possible, your child has to keep notes, read several clues at once and rule out what can't be true. That is real reasoning, packed into a two-player game.

How to play

The color version, for kids around 7 or 8:

  • The code keeper picks 3 colors out of 6: red, yellow, green, blue, orange and brown. No color is used twice, and the order matters. Color three dots in a corner of the paper and cover them with a scrap of card.
  • The guesser colors a row of three dots. The keeper answers with small dots to the right of the row: a black dot for each color that is right and in the right place, a white dot for each color that is in the code but in the wrong place.
  • The hint only gives how many dots, never which colors. Working that out is the whole game.

The number version, for kids around 9 to 12: the code is 4 different digits from 0 to 9, and hints are given in words. Say the code is 4271:

Guess Hint Why
1234 1 right place, 2 wrong place The 2 is in the right place; the 1 and the 4 are in the code but in the wrong place
5689 0 right place, 0 wrong place That rules out 5, 6, 8 and 9 in one go
4217 2 right place, 2 wrong place The 4 and the 2 are in the right place; the 1 and the 7 are in the wrong place

Write every guess in a column down the page with its hint right beside it. Once the code is cracked, swap roles; whoever needs fewer guesses wins.

A sample game, solved step by step

The secret code is blue, red, yellow. The guesser doesn't know that yet.

A sample game on grid paper: the top row shows the secret code, blue, red, yellow. Below are four guesses: red, yellow, green with two white dots; blue, orange, brown with one black dot; green, orange, brown with no dots; blue, red, yellow with three black dots.

  1. Red, yellow, green: two white dots. Two of these three colors are in the code, but not where they were guessed: red isn't in spot 1, yellow isn't in spot 2, green isn't in spot 3.
  2. Blue, orange, brown: one black dot. Exactly one of these three colors is in the code, and it is in the spot where it was guessed. So the code is two colors from guess 1 plus one color from guess 2.
  3. Green, orange, brown: no dots. This guess can't be the code, and the guesser knows it. It is a question guess: are green, orange and brown in the code? The answer is no. Back to guess 1: green is out, so red and yellow are both in. Back to guess 2: orange and brown are out, so blue is in, and it sits in spot 1.
  4. Blue, red, yellow: three black dots. Red and yellow fill spots 2 and 3. In guess 1, yellow was in spot 2 and only got a white dot, so yellow isn't in spot 2. Yellow goes in spot 3 and red in spot 2. Solved in four guesses.

Two things are worth pointing out to your child: read several guesses together, because one guess alone rarely tells you enough, and a guess can also be a question, chosen so that any answer teaches you something new.

Tips for keeping track and ruling things out

  • Write a row of all the colors (or all ten digits) at the bottom of the page. Cross out the ones you know are out; circle the ones you know are in.
  • Mark "not in this spot" with a small tick under a dot, like yellow not being in spot 2 in the sample game.
  • Before each guess, ask: "What will this guess tell me that I don't know yet?" Guessing a code you have already ruled out wastes a turn.
  • The code keeper has to give hints carefully. One wrong hint muddles the whole game and the guesser may never crack it. If you keep the code, check every hint twice; if your child keeps it, look over the hints together. Giving accurate hints is good practice in being careful.

Making it easier or harder

Rough age Ideas
7–8 A code of 2 colors out of 4; or 3 colors, with the keeper saying which color is in the right place
8–10 A code of 3 colors out of 6, like the sample game; no limit on guesses
10–12 A code of 4 different digits; a limit of 8 to 10 guesses; or two teams who each hide a code and race to crack the other's

Every child is different. When your child is new to the game, think out loud for the first few guesses: "Two white dots means two colors are right but in the wrong spots, so let's try moving them."

In Dologi, the Logic topic has "Number square" puzzles, where children put each number once in every row and every column. It is the same kind of ruling out: once you know which numbers can't go in a square, only one choice is left, just like crossing off colors on a code-breaking sheet.

In short

  • One player hides a code, the other guesses, and the hint only says how many are in the right place and how many are in the wrong place.
  • Younger kids play with 3 colors; older kids play with 4 different digits.
  • Read several guesses together, cross off what has been ruled out, and use guesses as questions.
  • The code keeper gives hints carefully, because one wrong hint spoils the game.

Read more: Guess my number: the higher-or-lower game for children, Number grid puzzles for children: when to start and how to begin with small grids