Skip to content

Bulls and Cows is a 2 player game. One player thinks of a number, while the other player tries to guess it.

Notifications You must be signed in to change notification settings

Shrinidhi1/Bulls-and-Cows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Bulls-and-Cows

Bulls and Cows is an old code-breaking mind or paper and pencil game for two or more players, predating the commercially marketed board game Mastermind.
Bulls and Cows is a 2 player game. One player thinks of a number, while the other player tries to guess it.

  1. The number to be guessed must be a 4 digit number, using only digits from 1 - 9, each digit atmost once. e.g. 1234 is valid, 0123 is not valid, 9877 is not valid, 9876 is valid.
  2. For every guess that the player makes, he gets 2 values - the number of bulls and the number of cows. 1 bull means the guess contains and the target number have 1 digit in common, and in the correct position. 1 cow means the guess and the target have 1 digit in common, but not in correct position. e.g. Let the target be 1234. Guessing 4321 will give 0 bulls and 4 cows. 3241 will give 1 bull and 3 cows. 4 bulls means you have won the game!

About

Bulls and Cows is a 2 player game. One player thinks of a number, while the other player tries to guess it.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages