Question
You are to write a program in MIPS assembly for use in the SPIM simulator. The program will implement a single player guessing game. The
You are to 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:
Your code must be well-commented to receive full credit. This means any non-trivial line of code should have an accompanying comment. For examples of appropriate comments, refer to any of the code examples on Canvas.
Add appropriate welcome/goodbye messages to the program (in addition to the prompt messages, etc. as part of the game).
The program should allow for a maximum of 10 guesses by the player.
If the user makes 10 incorrect guesses, print an appropriate you lose message and end the program.
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.
Test your program using the following inputs.
Secret number: 4
Guesses: 42 23 16 15 8 4
Secret number: 17
Guesses: 5 20 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
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