Number Baseball

Bulls and Cows · Crack the hidden number with strikes and balls

Number Baseball

Select Game Mode

← Home

Your guesses

    Opponent guesses

      How to Play

      How to Play Number Baseball

      Number Baseball (also known as Bulls and Cows) is a deduction game: you work out a hidden number from nothing but clues. The hidden number uses 3 different digits from 1 to 9 (or 4, if you pick 4 digits), and every guess you make earns a clue.

      • Strike (S): right digit in the right place
      • Ball (B): right digit in the wrong place
      • Out: none of your digits are in the number

      For example, if the answer is 381 and you guess 318, the 3 is in the right place (1 strike) and the 1 and 8 are in the number but in the wrong places (2 balls), so the clue is "1S 2B". No digit can repeat, and 0 is not used.

      How Many Codes, and What the First Guess Tells You

      There are 9×8×7 = 504 ways to pick 3 different digits from 1 to 9 in order, and 9×8×7×6 = 3,024 for 4 digits. Every first guess is equally good: relabel the digits and positions and they all look the same.

      Here is how likely each clue is after the first guess with 3 digits, counted over all 504 codes.

      ClueCodes leftChance
      1B18035.7%
      Out12023.8%
      1S9017.9%
      2B5410.7%
      1S 1B367.1%
      2S183.6%
      1S 2B30.6%
      3B20.4%
      Hit10.2%

      One clue cuts 504 codes down to at most 180. An "out" feels like a waste, but it wipes out all three digits at once, leaving only the 120 codes made from the other six digits. With 4 digits, the most common first clue is 2B (27.8%), and an out is rare (4.0%).

      Tips for Winning

      • Only guess numbers that fit every clue so far. That alone makes you strong. Picking any such number at random solved 3-digit codes in 4.83 guesses on average, and never more than 8, over 2,000 measured games.
      • Move balls around. A ball means the digit is in the number, so try it in a different position next and see if it turns into a strike.
      • Use outs to cross digits off. A digit that came back as an out is nowhere in the number, so drop it right away.
      • Write clues down as they pile up. After three or four clues, memory alone gets unreliable. Note for each digit "not in it / somewhere / this spot".
      • Don't rush in a duel. Even if the first player hits, the second still gets one last try, so steady narrowing beats wild guessing.

      How Omokboard's AI Plays

      Easy remembers only the last 2 clues and Normal only the last 3, then picks a number that fits them, a bit like a person who forgets earlier hints. Hard uses every clue and picks the number that leaves the fewest codes on average after the next clue.

      Average guesses for the AI to solve a code alone, over 1,000 games per level (measured October 25, 2026):

      Level3 digits4 digits
      Easy8.111.2
      Normal5.76.7
      Hard4.7 (max 6)5.0 (max 7)

      Luck matters a lot in a duel. Over 1,000 AI-vs-AI games with 3 digits, Hard went 486 wins, 209 draws, and 305 losses against Normal. Measurements for the other games are in AI Difficulty Benchmarks.

      Online Play

      Create a room and send the 6-character room code or link to play a friend in real time. The room creator picks the number of digits and guesses first, and the first player switches with every rematch.

      Online, only the server knows the secret numbers. Your number is never sent to your opponent's browser. When they guess, the server judges it and sends both of you just the clue. Even opening the developer tools won't show the other number, and both numbers are revealed only when the game ends. See the online play guide for how room codes work.

      FAQ

      • Is 0 used? No. Omokboard's Number Baseball uses only 1 to 9, which gives 504 codes with 3 digits and 3,024 with 4.
      • Can a digit repeat? No. Both the hidden number and every guess must use different digits in each position.
      • How many guesses is good? With 3 digits, Omokboard's Hard AI averages 4.7 guesses and never needs more than 6. If you solve it within 6, you're playing at about the Hard AI's level.
      • Where is my best record saved? Your solo best is saved per digit count in this browser only. There are no accounts, so it doesn't carry over to other devices.
      • Can my opponent see my number online? No. Your number is stored only on the server, and your opponent receives just the clues. Both numbers are revealed when the game ends.