Peruttu

Tic tac toe Assembly language

.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

Taidot: Assembly, C-ohjelmointi, C++ -ohjelmointi, tietojärjestelmäarkkitehtuuri, x86/x64 Assembler

Näytä lisää: tic tac toe program language, tic tac toe source code language, tic tac toe language code 7x7, tic tac toe assembly 8086, tic tac toe asm, tic tac toe masm, tic tac toe assembly masm, print tic tac toe board screen assembly language, tic tac toe language, tic tac toe using assembly language, irvine32 assembly language tic tac toe, assembly language tic tac toe, tic tac toe assembly language, tic tac toe game assembly language, tic tac toe java, tic tac toe bidding, need tic tac toe game java board, tic tac toe game turbo prolog, tic tac toe vbnet

Tietoa työnantajasta:
( 0 arvostelua ) Dublin, United States

Projektin tunnus: #16346124

6 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön

$100 USD 1 päivässä
(50 arvostelua)
5.7
$150 USD 1 päivässä
(121 arvostelua)
5.7
raulbehl

Hello! Please check my reviews and profile to know more about me and my work. I have designed games before and should be able to do it for you as well. Thank you!

$55 USD 3 päivässä
(70 arvostelua)
5.7
$25 USD 1 päivässä
(16 arvostelua)
3.6
Sindustrus

Hey! Hope so you are fine. I have got experties in C programming and i wanna do this task as i have done this kind of work previously . I’ll definitely don’t put you backward in this regard. Have a good day! Thanks.

$15 USD 1 päivässä
(0 arvostelua)
0.0
babur1234

It’s a very simple program just send it i will debug and will send you the correct running program

$25 USD 3 päivässä
(0 arvostelua)
0.0