Question: Math - match game, option Multiply Easy . Minimum requirements for the program: The game is for one player. The program provides the game environment

Math-match game, option Multiply Easy. Minimum requirements for the program:
The game is for one player. The program provides the game environment for the user.
The game board is displayed using ASCII characters (e.g.,-,+, and |) is the minimum requirement. Creative ways to display the board, e.g. with graphics, will earn extra credits.
Extra credits will be given for:
Graphic (10 pts) and sound (5pts)
These extra credit features MUST be documented in your report and explained well to unlock these extra credits.
IMPORTANT: The program must be developed as multiple modules (i.e. multiple .asm files), each module implements one part of the game. If the program is implemented as one file points will be severely deducted.
help me do this. making sure it is separate modules
this is what i have i keep getting errors in main, question_gen, and end_ game.
main:
# main.asm
.data
welcome_msg: .asciiz "Welcome to the game!
"
.text
.globl main
main:
# Initialize the game
jal game_init # Calls the game_init function from game_init.asm
# Continue with the rest of the game logic...
Error: Assemble: assembling /Users/jannahshahin/Desktop/mars/main.asm
Error in /Users/jannahshahin/Desktop/mars/main.asm line 10 column 9: Symbol "game_init" not found in symbol table.
Assemble: operation completed with errors.
get_input:
# Player Input Module
.data
input_prompt: .asciiz "
Enter your answer: "
correct_msg: .asciiz "
Correct!
"
incorrect_msg: .asciiz "
Incorrect, try again.
"
.text
get_input:
# Display the input prompt
li $v0,4
la $a0, input_prompt
syscall
# Get the player input (answer)
li $v0,5 # Read integer
syscall
move $t2, $v0 # Save the answer in $t2
# Check if the answer is correct
mul $t3, $s0, $s1 # Multiply num1 and num2
beq $t2, $t3, correct_answer # If correct, jump to correct_answer
incorrect_answer:
li $v0,4
la $a0, incorrect_msg
syscall
j get_input # Ask the player to try again
correct_answer:
li $v0,4
la $a0, correct_msg
syscall
game_init:
# game_init.asm
.data
welcome_msg: .asciiz "Welcome to the Multiply Easy Game!
"
board_msg: .asciiz "Your task is to answer multiplication questions.
"
instructions_msg: .asciiz "Good luck! Answer the questions correctly.
"
newline: .asciiz "
"
.text
.globl game_init
game_init:
# Display the welcome message
li $v0,4 # System call to print a string
la $a0, welcome_msg
syscall
# Display the board message
li $v0,4 # System call to print a string
la $a0, board_msg
syscall
# Display the instructions message
li $v0,4 # System call to print a string
la $a0, instructions_msg
syscall
# Display a newline
li $v0,4 # System call to print a string
la $a0, newline
syscall
# Return from the game_init function
jr $ra
game_logic:
# Game Logic Module
.data
score_msg: .asciiz "Your score: "
score: .word 0 # Initial score
.text
update_score:
# Add 1 point for each correct answer
lw $t0, score # Load current score
addi $t0, $t0,1 # Increment the score
sw $t0, score # Store updated score
# Display the score
li $v0,4
la $a0, score_msg
syscall
li $v0,1
move $a0, $t0
syscall
# Question Generation Module
.data
question_msg: .asciiz "What is: "
.text
question_gen:
# Generate random numbers between 1 and 10
li $v0,42 # System call for random number
syscall
andi $t0, $v0,0xF # Mask to get a number between 0 and 15
addi $t0, $t0,1 # Ensure the number is between 1 and 10
# Save the random number as 'num1'
move $s0, $t0
# Generate second number (same range)
li $v0,42
syscall
andi $t1, $v0,0xF
addi $t1, $t1,1 # Ensure the number is between 1 and 10
# Save the random number as 'num2'
move $s1, $t1
# Display the question (e.g., "What is: 3*5?")
li $v0,4
la $a0, question_msg
syscall
question_gen:
# Print num1(first number)
li $v0,1
move $a0, $s0
syscall
# Print the multiplication sign
li $v0,4
la $a0, multiplication_sign
syscall
# Print num2(second number)
li $v0,1
move $a0, $s1
syscall
# Print the question mark
li $v0,4
la $a0, question_end
syscall
Error: Assemble: assembling /Users/jannahshahin/Desktop/mars/question_gen.asm
Error in /Users/jannahshahin/Desktop/mars/question_gen.asm line 37 column 13: Symbol "multiplication_sign" not found in symbol table.
Assemble: operation completed with errors.
end_game:
# End Game Module
.data
game_over_msg: .asciiz "
Game Over!
"
.text
end_game:
li $v0,4
la $a0, game_over_msg
syscall
li $v0,4
la $a0, score_msg
syscall
lw $t0, score
li $v0,1
move $a0, $t0
syscall
Error:
Error in /Users/jannahshahin/Desktop/mars/end_game.asm line 12 column 13: Symbol "score_msg" not found in symbol table.
Assemble: operation completed with errors.

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!