Question: ( Tic - Tac - Toe ) For this project, You only need to submit your codes, but provide comments in your source code to

(Tic-Tac-Toe) For this project, You only need to submit your codes, but provide comments in your source code to clarify each part of your code.
Create a class TicTacToe that will enable you to write a program to play Tic-Tac-Toe. The class contains a private 3-by-3 two-dimensional array. Use an enum type to represent the value in each cell of the array. The enum's constants should be named x,O, and EMPTY (for a position that does not contain an X or an O). The constructor should initialize the board elements to EMPTY. Allow two human players. Wherever the first player moves, place an X in the specified square, and place an O wherever the second player moves. Each move must be to an empty square. After each move, determine whether the game has been won and whether it's a draw. If you feel ambitious, modify your program so that the computer makes the moves for one of the players. Also, allow the player to specify whether he or she wants to go first or second.
Extra bonus! If you feel exceptionally ambitious, develop a program that will play threedimensional Tic-Tac-Toe on a 4-by-4-by-4 board. The game board is as follows:3D Tic Tac Toe
Take turns placing your symbol in a square.
The first person to connect 4 squares wins.
You can connect vertically, horizontally, or diagonally. You can connect on the same level or across all 4 levels. Here, 0 wins:
You can represent it as four 2-D matrices on the screen.
Please do not take from other solutions and solve again a second year computer engineer level.
( Tic - Tac - Toe ) For this project, You only

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!