Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using C programming, In the simple, text-version of Mastermind game that we are going to develop, instead of colors we simply use digits 1 to
using C programming,
In the simple, text-version of Mastermind game that we are going to develop, instead of colors we simply use digits 1 to 9. Therefore, codemaker (Computer) will randomly selects four unique, non- duplicated, digits and then codebreaker will start guessing the four digits. If the codebreaker guesses the correct code in less then or equal to ten guesses, s/he wins and otherwise loses. Then, the codebreaker has the opportunity to play again or just exit from the game. In each step of the game, proper message should be provided by the codemake (computer) to the codebreaker. For instance, at the beginning there would be a welcome message, followed by asking the codebreaker to guess the code. After each guess, an accurate feedback should be shown to the codebreaker. If codebreaker wins/loses, proper message showed be shown to the codebreaker as well. You can get some ideas from the sample execution of the program on page 4 of this document. Part B: Pseudocode: (40 marks) Using the above ame rules, write the pseudocode (formal or informal) for the Mastermind game. As a hint, we start it as follows, and you should complete it: 1. Start 2. Show a Welcome message to the player. 3. Generate a random code. 4. ... Complete the next steps X. Ask the player if they want to play again or not a. If yes, go to step 3 b. If no, show a Goodbye message and end the program X+1. End In the simple, text-version of Mastermind game that we are going to develop, instead of colors we simply use digits 1 to 9. Therefore, codemaker (Computer) will randomly selects four unique, non- duplicated, digits and then codebreaker will start guessing the four digits. If the codebreaker guesses the correct code in less then or equal to ten guesses, s/he wins and otherwise loses. Then, the codebreaker has the opportunity to play again or just exit from the game. In each step of the game, proper message should be provided by the codemake (computer) to the codebreaker. For instance, at the beginning there would be a welcome message, followed by asking the codebreaker to guess the code. After each guess, an accurate feedback should be shown to the codebreaker. If codebreaker wins/loses, proper message showed be shown to the codebreaker as well. You can get some ideas from the sample execution of the program on page 4 of this document. Part B: Pseudocode: (40 marks) Using the above ame rules, write the pseudocode (formal or informal) for the Mastermind game. As a hint, we start it as follows, and you should complete it: 1. Start 2. Show a Welcome message to the player. 3. Generate a random code. 4. ... Complete the next steps X. Ask the player if they want to play again or not a. If yes, go to step 3 b. If no, show a Goodbye message and end the program X+1. EndStep 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