cools maths gamesSurprise me

Bulls and Cows

Read black and white peg clues to deduce a secret four-shape code within your limited guesses.

Bulls and Cows title screen
  • Works on mobile
Report a problem

Bulls and Cows is a code-breaking puzzle built on pure logic. A secret row of four shapes is hidden from you, and every guess earns a few pegs that hint at how close you are. Your goal is to name the exact code before you run out of tries.

How Bulls and Cows Works

Each of the four slots holds one of six shapes: circle, square, triangle, diamond, star or cross. Tap a slot to cycle its shape, fill all four, and submit. A counter above the slots tracks guesses used and left.

A black peg means one shape is right and in the right slot. A white peg means one shape is in the code but sits somewhere else. The pegs never say which slot they belong to, only how many of each you earned.

Every guess stays listed under the board with its pegs, so you can compare clues as they build up. The Daily Challenge gives every player the same Medium code, worked out from the date in your browser.

Your First Few Minutes

  1. Choose Easy, then start a new game.
  2. Make a first guess with four different shapes.
  3. Count the pegs. Black plus white tells you how many of those shapes are in the code.
  4. Swap just one or two slots on your next guess so you can see which change moved the pegs.
  5. Before each submit, check that your guess fits every clue you already have.

Controls for Bulls and Cows

Keyboard, mouse and touch controls for Bulls and Cows
To do thisKeyboardMouseTouch screen
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 codenot usedChoose 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 puzzlenot usedClick "Daily Challenge"Tap "Daily Challenge"

What It Trains

This is deduction in its plain form. You hold several clues in mind at once and rule out every code that would have produced different pegs.

You also learn to design guesses that test one idea at a time, much like a small experiment. Keeping track of earlier rows builds working memory.

Strategy Notes

  • Spend early guesses on variety. Four new shapes reveal more than a guess that repeats one.
  • Change little between guesses. Small edits make it clear which shape caused a peg to appear or vanish.
  • Drop zero-peg shapes. A guess with no pegs means none of those four shapes are in the code.
  • Expect doubles on Medium and Hard. A shape that already scored may still appear twice.
  • Test against the whole history. A guess that contradicts an old clue is a wasted turn.

Good to Know

Bulls and Cows runs well on phones held upright and works with mouse, touch or keyboard. There are no sounds, and nothing is sent to a server. This version comes from Christopher Müller’s open-source PaperGames collection.

Bulls and Cows questions and answers

Which level should a beginner pick in Bulls and Cows?

Start on Easy. You get 12 guesses and the code never repeats a shape, which keeps the reasoning simple. Medium allows repeats with 10 guesses, and Hard allows repeats with only 8, so each step asks for tighter logic.

What happens when my guesses run out?

The round ends and the game reveals the hidden code, so you can look back at your clues and see where your reasoning slipped. Then you can start a new code at any level.

Will I lose my game if I close the tab?

No. The game in progress is saved in your browser, so your guesses and clues are still there when you return on the same device.

Does guessing a shape twice earn extra pegs?

No. Each shape in the code can be matched only once. If the code holds one star and you guess two, at most one peg comes from stars.

Games that use logic like Bulls and Cows

Different rules, same kind of thinking.

Try something from another shelf