Author: Ege Germen
This project is a Java-based implementation of Tic-Tac-Toe in a three-dimensional 4x4x4 grid. It's a console application that brings a new layer of strategy to the classic game.
- Three-Dimensional Gameplay: The game is played on a 4x4x4 cube, requiring players to think in 3D to secure a win.
- Player vs. Player Mode: Challenge a friend in a local hot-seat match.
- Player vs. AI Mode: Play against a computer opponent. The AI makes random moves, providing a fun and unpredictable challenge.
- Turn Selection: You can choose to go first (playing as 'X') or second (playing as 'O').
- Complete Win Detection: The game checks for winning conditions in every possible direction—horizontally, vertically, and across all 3D diagonals.
-
Compile the Java code:
javac TicTacToe3D.java
-
Run the game:
java TicTacToe3D
-
The game will prompt you to choose your opponent (Human or Computer).
-
You will then be asked if you want to make the first move.
-
To make a move, enter the row, column, and depth (0-3 for each) separated by spaces. For example:
1 2 3 -
The first player to get four of their marks in a row wins!