Bulls and Cows is a classic code-breaking game, and this version swaps colored pegs for six crisp shapes. A secret four-slot code is hidden from you, and after every guess you get a short peg report on how close you came. Bulls and Cows comes from Christopher Müller’s open-source PaperGames collection, and it is one of the best small workouts for logical elimination you can play in a few minutes.

Making a guess

Each slot holds a circle, square, triangle, diamond, star or cross. Tap a slot to cycle through the shapes, fill all four, then press Submit guess. The reply arrives as pegs:

  • One black peg for each shape that is correct and in the right slot.
  • One white peg for each shape that is in the code but in a different slot.

Your past guesses stack up under the board with their pegs, and a counter shows how many tries are left. Hit the exact code to win. If you run out, the answer is revealed.

Bulls and Cows Controls

Controls for Bulls and Cows
ActionKeyboardMouseTouch
Change the shape in a slotTab to the slot, then Enter to cycleClick the slot to cycle through the six shapesTap the slot to cycle through the six shapes
Check your guessTab to "Submit guess", then EnterClick "Submit guess"Tap "Submit guess"
Start a new code—Choose a level, then click "New game" (open "Menu" if it is hidden)Choose a level, then tap "New game" (open "Menu" if it is hidden)
Play today's shared puzzle—Click "Daily Challenge"Tap "Daily Challenge"

The math hiding in the pegs

With six shapes and four slots there are 1,296 possible codes when repeats are allowed, and 360 when every shape is different. Each guess splits that pool into groups based on the pegs it would earn. A good guess makes those groups small, which is the same idea computer scientists use when they talk about information and search.

You do not need to calculate anything to play well, though. You just need to keep asking one question: which codes are still possible after everything I have seen?

Strategy that works

  1. Open with four different shapes. It tells you about four shapes at once instead of three or fewer.
  2. Change one or two slots at a time. If the pegs shift, you know which change caused it.
  3. Strike out shapes that scored zero. A guess with no pegs at all removes four shapes from the whole game.
  4. Keep repeats in mind on Medium and Hard. A shape that already earned a peg may still appear a second time.
  5. Test before you submit. Imagine your new guess is the secret code and check that it would give the same pegs to every earlier guess. If it would not, it cannot be the answer.

Practical Notes for Players

A game in progress stays saved in your browser, so you can close the tab and come back. A round usually takes five minutes or less. If you like squeezing answers out of feedback, try Black Box Lasers, or look for a number pattern challenge in Logic Mines.

Tested and updated: