Question: Math - match game, option Multiply Easy . Minimum requirements for the program: The game is for one player. The program provides the game environment
Mathmatch 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 eg and is the minimum requirement. Creative ways to display the board, eg with graphics, will earn extra credits.
Extra credits will be given for:
Graphic pts and sound pts
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 ie 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, questiongen, and end game.
main:
# main.asm
data
welcomemsg: asciiz "Welcome to the game!
text
globl main
main:
# Initialize the game
jal gameinit # Calls the gameinit function from gameinit.asm
# Continue with the rest of the game logic...
Error: Assemble: assembling UsersjannahshahinDesktopmarsmainasm
Error in UsersjannahshahinDesktopmarsmainasm line column : Symbol "gameinit" not found in symbol table.
Assemble: operation completed with errors.
getinput:
# Player Input Module
data
inputprompt: asciiz
Enter your answer:
correctmsg: asciiz
Correct!
incorrectmsg: asciiz
Incorrect, try again.
text
getinput:
# Display the input prompt
li $v
la $a inputprompt
syscall
# Get the player input answer
li $v # Read integer
syscall
move $t $v # Save the answer in $t
# Check if the answer is correct
mul $t $s $s # Multiply num and num
beq $t $t correctanswer # If correct, jump to correctanswer
incorrectanswer:
li $v
la $a incorrectmsg
syscall
j getinput # Ask the player to try again
correctanswer:
li $v
la $a correctmsg
syscall
gameinit:
# gameinit.asm
data
welcomemsg: asciiz "Welcome to the Multiply Easy Game!
boardmsg: asciiz "Your task is to answer multiplication questions.
instructionsmsg: asciiz "Good luck! Answer the questions correctly.
newline: asciiz
text
globl gameinit
gameinit:
# Display the welcome message
li $v # System call to print a string
la $a welcomemsg
syscall
# Display the board message
li $v # System call to print a string
la $a boardmsg
syscall
# Display the instructions message
li $v # System call to print a string
la $a instructionsmsg
syscall
# Display a newline
li $v # System call to print a string
la $a newline
syscall
# Return from the gameinit function
jr $ra
gamelogic:
# Game Logic Module
data
scoremsg: asciiz "Your score:
score: word # Initial score
text
updatescore:
# Add point for each correct answer
lw $t score # Load current score
addi $t $t # Increment the score
sw $t score # Store updated score
# Display the score
li $v
la $a scoremsg
syscall
li $v
move $a $t
syscall
# Question Generation Module
data
questionmsg: asciiz "What is:
text
questiongen:
# Generate random numbers between and
li $v # System call for random number
syscall
andi $t $vxF # Mask to get a number between and
addi $t $t # Ensure the number is between and
# Save the random number as 'num
move $s $t
# Generate second number same range
li $v
syscall
andi $t $vxF
addi $t $t # Ensure the number is between and
# Save the random number as 'num
move $s $t
# Display the question eg "What is:
li $v
la $a questionmsg
syscall
questiongen:
# Print numfirst number
li $v
move $a $s
syscall
# Print the multiplication sign
li $v
la $a multiplicationsign
syscall
# Print numsecond number
li $v
move $a $s
syscall
# Print the question mark
li $v
la $a questionend
syscall
Error: Assemble: assembling UsersjannahshahinDesktopmarsquestiongen.asm
Error in UsersjannahshahinDesktopmarsquestiongen.asm line column : Symbol "multiplicationsign" not found in symbol table.
Assemble: operation completed with errors.
endgame:
# End Game Module
data
gameovermsg: asciiz
Game Over!
text
endgame:
li $v
la $a gameovermsg
syscall
li $v
la $a scoremsg
syscall
lw $t score
li $v
move $a $t
syscall
Error:
Error in UsersjannahshahinDesktopmarsendgame.asm line column : Symbol "scoremsg 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
