Find Jobs
Hire Freelancers

Assembly Language

$10-30 USD

処理中
投稿日: 約6年前

$10-30 USD

完了時にお支払い
.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
プロジェクト ID: 16341530

プロジェクトについて

2個の提案
リモートプロジェクト
アクティブ 6年前

お金を稼ぎたいですか?

Freelancerで入札する利点

予算と期間を設定してください
仕事で報酬を得る
提案をご説明ください
登録して仕事に入札するのは無料です
アワード者:
ユーザーアバター
$25 USD 1日以内
0.0 (0 レビュー)
0.0
0.0
この仕事に2人のフリーランサーが、平均$25 USDで入札しています
ユーザーアバター
what exactly you want.
$25 USD 2日以内
0.0 (0 レビュー)
0.0
0.0

クライアントについて

UNITED STATESのフラグ
United States
0.0
0
お支払い方法確認済み
メンバー登録日:2月 21, 2018

クライアント確認

ありがとうございます!無料クレジットを受け取るリンクをメールしました。
メールを送信中に問題が発生しました。もう一度お試しください。
登録ユーザー 投稿された仕事の合計
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
プレビューを読み込み中
位置情報へのアクセスが許可されました。
あなたのログインセッションの有効期限がきれ、ログアウトされました。もう一度ログインしてください。