Find Jobs
Hire Freelancers

Assembly Language

$10-30 USD

In Progress
Posted about 6 years ago

$10-30 USD

Paid on delivery
.data currentState: .asciiz "This is the current state of the GameBoard:\n" playerOne: .asciiz "Player One won\n" playerTwo: .asciiz "Player Two won\n" playerNone: .asciiz "No winners found\n" CR: .byte '\n SPACE: .byte 0x20 O: .byte 'o X: .byte 'x DOT .byte '. # enable only one at a time to test your code # it should detect the win for the designated player # gameBoard: .byte 0,0,0,0,0,0,0,0,0 # no winner #gameBoard: .byte 1,1,1,0,0,0,0,0,0 # player one wins - by row 0 #gameBoard: .byte 0,0,0,-1,-1,-1,0,0,0 # player two wins - by row 1 #gameBoard: .byte 0,0,0,0,0,0,-1,-1,-1 # player two wins - by row 2 #gameBoard: .byte 1,0,0,1,0,0,1,0,0 # player one wins - by col 0 #gameBoard: .byte 0,1,0,0,1,0,0,1,0 # player one wins - by col 1 #gameBoard: .byte 0,0,-1,0,0,-1,0,0,-1 # player two wins - by col 2 #gameBoard: .byte 1,0,0,0,1,0,0,0,1 # player one wins - by diag 0 #gameBoard: .byte 0,0,-1,0,-1,0,-1,0,0 # player two wins - by diag 1 .code .globl main ########################################################################## # CheckTriplet # Check the gameboard positions matching the triplet passed in # to determine either player has won that specific triplet. # # Input: # $a0 : first position to check on gameboard # $a1 : second position to check on gameboard # $a2 : third position to check on gameboard # # Output: # $v0 : 0 = no winner found # $v0 : 1 = player one won # $v0 : -1 = player two won # AS WELL AS an appropriate message if player one or player two has won # ########################################################################## CheckTriplet: # ENTER YOUR CODE HERE done: jr $ra ########################################################################## # CheckForWin # Invoke CheckTriplet against the 8 possible winning combinations # to determine if anyone has won the game yet # row 0 # row 1 # row 2 # col 0 # col 1 # col 2 # diagonal 0 # diagonal 1 # # Output: # $v0 : 0 = no winner found # $v0 : 1 = player one won # $v0 : -1 = player two won ########################################################################## CheckForWin: addi $sp,$sp,-4 # make room on the stack for our variables sw $ra,0($sp) # save our return address # ENTER YOUR CODE HERE doneCFW: lw $ra,0($sp) # restore our return address addi $sp,$sp,4 # free the room we have taken on the stack jr $ra # return from function ########################################################################## # PRINTBOARD ########################################################################## PrintBoard: # COPY YOUR PAST IMPLEMENTATION HERE ########################################################################## # MAIN ########################################################################## main: jal PrintBoard jal CheckForWin bnez $v0,finished la $a0,playerNone # if no winners found, for now, just say so and exit syscall $print_string finished: syscall $exit
Project ID: 16341530

About the project

2 proposals
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0
2 freelancers are bidding on average $25 USD for this job
User Avatar
what exactly you want.
$25 USD in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
United States
0.0
0
Payment method verified
Member since Feb 21, 2018

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.