Ultimate Tic-Tac-Toe

Summary

Ultimate Tic-Tac-Toe is a game I played as a kid. The idea is that it is one large board built from 9 smaller Tic-Tac-Toe boards. In order to win the game, you must win in three of the smaller boxes creating three in a row on the bigger board like in the below image.

However there is a catch, whichever box you make your move in, corresponds to where the next player will make their move on the bigger board. For example if a player places an X on the right lower square of a smaller board, the player with O will have to place an O in any of the smaller boxes in the right lower square of the larger Tic-Tac-Toe board.

Java is the primary language for the game as the object oriented language is perfect for a simple game like Tic-Tac-Toe. It was made using netbeans as the IDE.

Details

The game is broken into 9 classes. Each class makes up the key elements of the game, a square, a Tic-Tac-Toe board, the ultimate board, the players, etc.

Position: I started by making each position the game would recognize, the 9 positions would be used for each Tic-Tac-Toe board and the Ultimate board.

Tic-Tac-Toe Square: I then created the class for each individual Tic-Tac-Toe square.

Tic-Tac-Toe board: This class defined the rules and positions for the small Tic-Tac-Toe board and assigned squares to each position.

Ultimate Tic-Tac-Toe board: By using the Tic-Tac-Toe board class I created the larger board with positions and rules.

Player: This keeps track of the player's position, which player it is and the colors of the player.

Tic-Tac-Toe Rules: This defined the regular rules of Tic-Tac-Toe for the Tic-Tac-Toe boards.

Ultimate Tic-Tac-Toe Rules: The UTTTR defined the unique rule set for the overall game, including the position relocating.

Winner: The winner class controlled keeping track of which boxes had been won, who won them and the color to be displayed on the won box.

Ultimate Tic-Tac-Toe: The final class, UTTT when run, starts the game and calls the visual effects of the game to be started and display the game.