Question: Create a RISC V program for Your task is to develop a number guessing game in using Assembly coding language. Your program must adhere to
Create a RISC V program for
Your task is to develop a number guessing game in using Assembly coding language. Your program must adhere to the following:
- Prompt the user to enter an integer number N that will serve maximum (e.g., the number that will be guessed will range from [0 N]
- Prompt the user to enter a seed S for the randomizer and initialize the randomizer
- Using the randomizer initialized above, generate a random number TARGET whose range is between [0 N]. You can write a random number generator function of your own.
- Prompt the user to guess a number X
- Determine whether X is equal to TARGET, near (within 10% of TARGET), or far (greater than 10% of TARGET)
- Inform the user on whether their = X was correct (e.g., X = TARGET) or near, or far
- If correct end program, If near or far, go back to step 4 (prompt the user to enter a number)
Note: You can assume that N as entered will be a valid positive integer and that N, as entered, will be large enough to ensure you can actually check for near and far. In other words, you are NOT required to perform an error checking on the user input. Also, in case there is no inbuilt function for randomizing, consider writing your own function for generating the same. Hint: A simple modulo (remainder) concept can be used to generate a random number.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
