peer2peergames

Bulls and Cows

The public domain game Mastermind was based on, played as a duel. You each hide a code and each try to break the other's, and the one thing that goes wrong across a kitchen table cannot happen here: the site counts, not your opponent.

Play Bulls and Cows Leaderboard

The rules

  1. Each player secretly chooses a four digit code. All four digits must be different, so 0427 is a code and 1123 is not.
  2. A code may start with a zero.
  3. Both codes are locked in before anybody guesses. Then you take turns guessing at each other's.
  4. Every guess is answered with two numbers: bulls and cows.
  5. A bull is a digit that is in the code AND in the right place.
  6. A cow is a digit that is in the code but somewhere else.
  7. Each digit counts once, so bulls and cows together never add up to more than four.
  8. Guessing a code you have already guessed is refused and costs you nothing: it is a slip, not a move.

Winning, and the extra guess

  1. Four bulls means you have broken the code.
  2. Breaking it does NOT end the game. Whoever went second always gets the guess that makes the counts equal, because otherwise going first would be worth something on its own.
  3. If they break it on that guess too, neither of you was faster and the game is a draw.
  4. Otherwise the player who broke it in fewer guesses wins.
  5. Fewer guesses is better: this is the one game here where the score counts down.

How a game ends

  1. One player breaks the code and the other fails to match them.
  2. Both break it in the same number of guesses, which is a draw.
  3. A resignation or a missed deadline ends the game against that player.
  4. Both codes are revealed either way, so you always find out what you were hunting.

Neither player ever scores a guess. Each code is sealed with a hash before a single guess is made and published when the game ends, so anybody reading the log can check that the code somebody finished with is the code they started with. That is what stops the oldest cheat in this game, which is miscounting the cows in your own favour.

Bulls and Cows terms

A bull
A digit in the code and in the right place.
A cow
A digit in the code but in the wrong place.
Sealing
Locking your code in. It is hashed before the first guess and published at the end, so it can be checked that it never changed.
The equalising guess
The guess the second player always gets after the first player breaks the code, so that going first is worth nothing.

Playing it here

  • Against a person or the bot. The bot needs no account and starts at once. To play a person, be rated and keep your games, you need an account: an email address and a password.
  • At your own pace. Every move has a deadline you both see, from five minutes to a week. A game can take an evening or it can take a fortnight.
  • Nothing to buy and nothing to win. No stakes, no prizes, no boosts, no undo. The only thing on offer is a place on a leaderboard, and only if you want one.
  • Every game can be checked. Anything decided by chance comes from the game's seed, and the seed is published the moment the game ends, so any finished game can be replayed and verified by anyone. See fair play.