This is a simple TicTacToe game implemented in C++ using the Visualization Toolkit (VTK). The game is played on a 3x3 grid of squares, and players take turns marking their symbol (Red or Blue) in an attempt to win the game.
-
Objective: The goal is to have three of your symbols (either Red or Blue) in a row, either horizontally, vertically, or diagonally.
-
Starting the Game: Run the C++ program, and a graphical window will appear with a 3x3 grid of squares.
-
Game Interface:
- The grid consists of 9 squares, each represented by a number:
Or
1 | 2 | 3 --------- 4 | 5 | 6 --------- 7 | 8 | 9
It Depends on your keyboard :)7 | 8 | 9 --------- 4 | 5 | 6 --------- 1 | 2 | 3
- Players will take turns marking their symbol in a square by pressing the corresponding number on the keyboard.
- The grid consists of 9 squares, each represented by a number:
-
Turns:
- Player 1 starts with Red symbols.
- Player 2 follows with Blue symbols.
- Alternately, players press the number key (1-9) to mark their symbol in the respective square.
-
Winning the Game:
- The game automatically detects a winner after each move.
- A player wins if they have three of their symbols in a row (horizontally, vertically, or diagonally).
- The winning player is announced, and the game resets for the next round.
-
Scores:
- The scores of Red and Blue players are displayed on the top of the window.
- The score is incremented for the winner of each round.
-
Restarting the Game:
- After a round is complete, a new game automatically starts.
- The scores are updated, and the grid is cleared for the next round.
-
Exiting the Game:
- Close the graphical window to exit the game.
- Press the number keys (1-9) on the keyboard to mark the corresponding square.
- Red Player Score: Displays the score of the Red player.
- Blue Player Score: Displays the score of the Blue player.
- The game window includes a title and a welcome message.
- The graphical interface is implemented using VTK for visualization.
Enjoy playing TicTacToe with VTK! For Any information, Contact Me : [email protected]