Tic-Tac-Toe is a simple two-player game played on a 3x3 grid. The objective is to be the first player to align three of your symbols in a row, column, or diagonal.
- Players can choose their symbol: Players are prompted to choose whether they want to be X or O at the start of the game.
- A player wins if they manage to align three of their symbols in any of the following ways:
- Horizontally: All three squares in a single row.
- Vertically: All three squares in a single column.
- Diagonally: All three squares in either diagonal.
If all 9 squares are filled without any player achieving alignment, the game ends in a tie.
- Starting the Game:
- You will be prompted to enter your name and choose whether you want to be X or O.
-
Single Player Modes:
- You can choose to play against:
- A dumb computer that makes random moves.
- An intelligent computer that blocks potential winning moves and tries to win.
- You can choose to play against:
-
Making a Move:
- The game displays the 3x3 board with empty squares.
- Enter the row and column numbers (0, 1, or 2) to place your symbol in the desired square.
- Example: Entering 1 for the row and 2 for the column places your symbol in the middle-right square.
-
Taking Turns:
- Players alternate turns until one player wins or the board is full.
- If you’re playing against the computer, it will make its move automatically after you make yours.
-
Ending the Game:
- The game ends when one player aligns three symbols or the board is completely filled (tie).
- The scoreboard is updated to reflect the outcome (win, lose, or tie).
- You can choose to play another round or exit.
- Choose your symbol wisely! Sometimes, picking the second turn can offer strategic advantages.
- Try to occupy the center square whenever possible; it increases your chances of winning.
- Block your opponent's potential winning moves whenever you spot them.
Enjoy the game and have fun!