Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I must finish this today it was due yesterday but my partner in this group assig

ID: 3681681 • Letter: I

Question

I must finish this today it was due yesterday but my partner in this group assignment dropped the class and did not finish his part. I'm at work and won't finish it on time if I try. Please I need some assembly lange guru to programm this for me if possible.

ASSIGNMENT: For this assignment, you are required to write a MIPS program that allows users to play an interactive game of Tic Tac Toe (Naughts and Crosses).

Represent your game board as a two-dimensional array of characters, with three rows and three columns. Other useful global variables include the following:

1.   whoseMove: a character used to remember which player get to make the next move. The value of whoseMove should alternate between ‘X’ and ‘O’ as the game proceeds.

2.   moveCount: an integer used to count the number of moves made during the current game.

At a minimum, your solution should include the following methods:

1.   ResetBoard: this void method clears the Tic Tac Toe board, sets whoseMove to ‘X’, and sets moveCount to 0.

2.   AddMove: this void method interactively prompts for and reads two integer values representing a selected row and column. Your method should display an appropriate error message and repeat the input process until the user enters row and column numbers between 1 and 3, inclusive, that specify an unoccupied board position. It should then place the current player’s token (‘X’ or ‘O’) in the selected position.

3.   DisplayBoard: this void method displays the current content of the board on the screen.

4.   IsAWin: this method returns a Boolean value that indicates whether the most recent move resulted in a win, which may occur in the current row, the current column, or along either diagonal.

Your main method should use these methods to allow users to play Tic Tac Toe. After each move, display the updated board on the screen. Loop until the game ends in a win or a draw (which occurs when the moveCount reaches 9 without a win). Your program should ask users whether they would like to play another game, and repeat until they decide not to do so. Be sure to reset the board at the beginning of each game.

IMPORTANT NOTE: always use a jal instruction to call a method, and always use a jr $ra instruction to return from that method to the calling routine.

As usual, you are encouraged to work in groups of two (or three, with my permission) on this assignment. Document your program in the manner required by the CSCE A248 MIPS Program Documentation and Style Guidelines. Be certain that each team member’s name and preferred email address is clearly indicated in the comment block at the top of your program. Submit your program as an email attachment. I will test your program by running it with the MARS MIPS emulator; check for good style and documentation; and send your grade back to each team member via e-mail.

Explanation / Answer

DATA SEGMENT:

.data

square: .byte '1', '2', '3', '4', '5', '6', '7', '8', '9'

tic: .asciiz " Tic Tac Toe "

P.Op: .asciiz " Player 1 (X) - Player 2 (0) "

b1: .asciiz " | | "

b2: .asciiz " "

b3: .asciiz " | "

b4: .asciiz "_____|_____|_____ "

b5: .asciiz " "

P1: .asciiz "Player 1, enter a number : "

P2: .asciiz "Player 2, enter a number : "

Invalid: .asciiz " Invalid move. Try again : "

PW1: .asciiz "Player 1 wins."

PW2: .asciiz "Player 2 wins."

d: .asciiz "The game is a draw."

TEXT SEGMENT:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote