Implement a CLI number guessing game with bulls and cows.
The user must guess a 4-digit number without repeated digits and has 7 attempts. Every guess must be a 4-digit number. They either win (guess correctly), lose (7th attempt wrong) or get a tip of X bulls and Y cows, where X is the number of correct digits in the correct positions and Y is the number of correct digits in wrong positions. If the number is 1234, then 1290 is 2 bulls and 0 cows, 1234 wins and 1562 is 1 bull and 1 cow. It should be a CLI program. 0123 is invalid (cannot start with 0), 1023 is valid, 1123 is invalid (repeated digits). Each new game gets a random number. Bonus: print "Gutter ball!!!" on 0 bulls and 0 cows, and never repeat the same number across games. Focus on setting up test cases first and be ready to write a unit test class.
Community answers
Related questions
Implement a Connect 4 game with working code.Implement a token ring with RingManager and RingElement classes.Related courses


