Question: This is a single - player game that tests both memory and ( very elementary ) math skills. Since MARS has neither event - driven
This is a singleplayer game that tests both memory and very elementary math skills. Since
MARS has neither eventdriven code nor graphics, you will have to do the following:
Display the game board using ASCII characters. Use question marks for cells where the
player has not yet made correct guesses. At the start of the game, you will display
rows and columns of question marks.
You can use ASCII characters such as and I to lay out the game board, although
my example below does not show this.
Player inputs will be in the form of a column and a row. Show the number or expression
in that cell. When they enter another cell ID show whatever is under that. If they match,
redisplay the game board with both showing. If not hide both. They have won when all
cells are showing an expression or a number. For example, if A contains then if I
choose A and it contains leave both showing.
When you redisplay the game board, you can have two boards showing after a first
guess, but only one after the second guess.
You can give the player some amount of time, or seconds or chosen by the player
to look at the board before you have the next one showing. For example, if I pick A
show me what's under A If I then pick B show what is under A and B and if
they're correct, show that board but nothing else. If they're not correct, show neither,
and redisplay.
I have provided a data file that contains an expression or number followed by some
spaces, a comma, and a number. If the numbers for two lines match, then each is the
correct answer for the other. Look at this file before you start coding.
There is a "sleep" syscall number that you can use to pause the program so the player
can look at the game board.
I will test with the game file in the MIPS directory, so just open it without any directories. That
is just open "MathData.txt without asking the user for the file name. If it is in the directory
with the MARS jar file it should work.
Remember to write comments first, then code. MathData.txt:
x
x
x
x
x
x
x
x
Please send code not only outline i am desperate
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
