Skip to content

The game is played with 4 digits number. Player and computer write a 4-digit secret number. The digits must be all different. Then, in turn, they try to guess the number and gives the number of matches for opponent. If the matching digits are in their right positions, they are "bulls", if in different positions, they are "cows". Example: Secret …

NUT82/BullsAndCows-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BullsAndCows-Game

The game is played with 4 digits number. Player and computer write a 4-digit secret number. The digits must be all different. Then, in turn, they try to guess the number and gives the number of matches for opponent. If the matching digits are in their right positions, they are "bulls", if in different positions, they are "cows". Example: Secret number: 4271 Opponent's try: 1234 Answer: 1 bull and 2 cows. (The bull is "2", the cows are "4" and "1".) The first one to reveal the other's secret number in the fewest guesses wins the game.

About

The game is played with 4 digits number. Player and computer write a 4-digit secret number. The digits must be all different. Then, in turn, they try to guess the number and gives the number of matches for opponent. If the matching digits are in their right positions, they are "bulls", if in different positions, they are "cows". Example: Secret …

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages