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 single-player game that tests both memory and (very elementary) math skills. Since
MARS has neither event-driven 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 4
rows and 4 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 A1 contains 4, then if I
choose A2 and it contains 3+1, 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, 3 or 4 seconds (or chosen by the player)
to look at the board before you have the next one showing. For example, if I pick A1,
show me what's under A1. If I then pick B1, show what is under A1 and B1, 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 32) 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:
6,1
2x3,1
4,2
2x2,2
6x7,3
42,3
3x4,4
12,4
3x3,5
9,5
1x6,6
6,6
4x5,7
20,7
5x5,8
25,8
Please send code not only outline i am desperate
This is a single - player game that tests both

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!