Question: Write a program in MIPS assembly for use in the SPIM simulator. The program will implement a single player guessing game. The program will ask
Write a program in MIPS assembly for use in the SPIM simulator. The program will implement a single player guessing game. The program will ask the player try to guess the
secret number. The program will output a message to indicate if the number guessed is too high or too low, and ask the player to enter a new number. If the number guessed by the
player matches the secret number, a congratulatory message will be displayed, followed by the number of tries it took the player to guess the secret number. The program should end at this
point.
Requirements:
1. Your code must be well-commented to receive full credit. This means any non-trivial line of code should have an accompanying comment
2. Add appropriate welcome/goodbye messages to the program (in addition to the prompt messages, etc. as part of the game).
3. The program should allow for a maximum of 10 guesses by the player.
a. If the user makes 10 incorrect guesses, print an appropriate you lose message and end the program.
4. You should hardcode the secret number as a single word in the .data section of the assembly code. Change the number for each test case below.
5. Test your program using the following inputs.
Secret number: 4
Guesses: 42 23 16 15 8 4
Secret number: 17
Guesses: 17
Secret number: 11
Guesses: 1 2 3 4 5 6 7 8 9 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
