UU Assignment Assembly Programming
UU Assignment Assembly Programming
NOTICE: It is strictly forbidden for a group to bring the same or a modified version of the
others.
Objectives
Instructions
You will implement a simple Tic Tac Toe game where two players take turns inputting
their moves, and the game checks for a winner or a draw after every move.
The game will be played on a 3x3 grid, and players will enter their moves by specifying
the row and column where they want to place their symbol (either 'X' or 'O').
The program will run in a loop until there is a winner or the game ends in a draw.
Requirements
1. Grid Representation:
o Use a 3x3 grid to represent the Tic Tac Toe board. You may use a 2D array or a
flat array (e.g., 9 elements in a list).
o Print the board to the console after each move.
o The positions on the board should be numbered from 1 to 9, so that players can
choose where to place their symbol (like a keypad).
2. Player Input:
o Players will be prompted to enter a number between 1 and 9 to choose the
position on the grid.
o Check for valid inputs (within the 1-9 range) and ensure the chosen position is
not already occupied.
3. Turn Handling:
o Alternate turns between the two players ('X' and 'O').
o Display whose turn it is after each move.
1
4. Win Checking:
o After each move, check if the player has won. A player wins if they have three of
their symbols in a row, column, or diagonal.
o If a player wins, display the winner and end the game.
5. Draw Checking:
o If all positions are filled and there is no winner, declare a draw.
6. Game Loop:
o The game should continue until there is a winner or a draw. You can achieve this
using a loop that checks the state of the game after each move.
Deliverables
1. Source Code:
o Submit the assembly source code for the game.
o The program must run without errors and function as specified.
2. Documentation:
o Provide brief documentation (comments) in the code explaining each part of the
program.
o Include a description of the input/output and how the game is played.
3. Test Cases:
o Test the game with different input scenarios, including:
A game that results in a win for player 'X' or player 'O'.
A game that results in a draw.
Invalid inputs (e.g., selecting an already occupied spot).
2
oInstead of printing numbers for positions, you can attempt to draw a simple
graphical representation of the grid on the console using ASCII characters.
3. Improved Input Validation:
o Enhance the input validation to handle out-of-bound inputs, invalid entries, or
the same cell being selected twice.
Evaluation Criteria