The classic two-player strategy game, with an optional AI opponent.
=== Tic Tac Toe ===
X | 2 | 3
---|---|---
4 | O | 6
---|---|---
7 | 8 | X
Player X, choose a cell
This is a console game built in C#. Two players take turns placing their mark (X or O) on a 3x3 grid. The first player to align three marks in a row, column, or diagonal wins the game. If all cells are filled with no winner, the game ends in a draw.
- Two Game Modes: Play against a friend locally, or challenge the AI
- AI Opponent: The AI randomly selects from available cells each turn
- Input Validation: Handles non-numeric input, out-of-range numbers, and already taken cells
- Play Again: Replay without restarting the program
- Clean Console UI: The board refreshes each turn for a smooth experience
- C#: Core programming language for all game logic
- Visual Studio / .NET : Used for development and execution
You will need the .NET SDK (version 6.0 or higher) installed on your system.
- Clone the repository
- Navigate to the project directory:
- Run the .cs file:
Once launched, you will be asked whether you want to play against the AI. The grid is numbered 1 to 9 as follows:
1 | 2 | 3
---|---|---
4 | 5 | 6
---|---|---
7 | 8 | 9
Enter the number of the cell you want to play each turn.
- Smarter AI that actually tries to block the player from winning
- Score tracker across multiple games
- Graphical interface
- Built from scratch as a learning project in C#