Question
(Python programming to play 'bulls and cows' game/ computer guesses the number) Hello every one Here is my question! I should write a program to
(Python programming to play 'bulls and cows' game/ computer guesses the number)
Hello every one Here is my question! I should write a program to play Bulls and Cows!!
Host(human player) should think about the secret number and the program should guess. Host should give hints to the program.
1. You are free to implement your program for 3-digit or 4-digit guessing, in python. 2. In the beginning of each game, indicate to the host the number of digits your program is designed to guess. 3. Inform the host to choose a secret number with no repeated digits and have it written down somewhere. 4. Prompt host to start the game 5. Your program as game-player starts to guess, after each guess, prompt host for feedback as described in the Overview session: a. How many correct digits? b. How many exact digits? (skip this question if Correct is 0) 6. Your program is required to verify the responses returned by the host. If needed, repeatedly prompt host to re-enter the correct information, such examples as: a. Non-numeric responses b. Value of Exact is greater than that of Correct c. Value of either Correct or Exact should be less than the length of the secret number (3 or 4) d. Inconsistent responses 7. Feedback History a. Keep a list of history of all guesses including corresponding feedback, and then display the entire list after each guess in chronological order 8. Termination a. the current guess matches the secret number i. In this case, display a congratulation message b. the number of guess attempts reaches the limit i. Display a game-over message c. the host enters x on any of the 2 feedback (Correct or Exact) 9. Termination Prompt a. After termination, prompt host to quit or to continue a new game. 10. Game Startup a. Show a welcome message to briefly describe what your program does b. Then prompt host for the secret number prior to starting the game 11. For 3-digit number implementation, your program MJST successfully guessed the secret number within 20 attempts. 12. For 4-digit number implementation, your program MJST successfully guessed the secret number within 40 attempts.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started