This is an implementation of the classic Tic Tac Toe game in C. The game allows players to play against each other or against an AI opponent.
- Human vs Human gameplay
- Human vs AI gameplay
- AI vs AI gameplay
- Simple command-line interface
- Minimax algorithm for AI decision making
- C compiler (e.g., GCC, Clang, or MSVC)
- Clone the repository:
git clone https://github.com/coding-pelican/tic-tac-toe-c.git
- Navigate to the project directory:
cd tic-tac-toe-c
- Compile the source code:
clang tic_tac_toe.c -o tic_tac_toe
- Run the game:
./tic_tac_toe
- Launch the game executable.
- From the main menu, select the game mode:
- Play with Another Player
- Play with A.I.
- Watch A.I. game play
- Follow the on-screen instructions to make your moves.
- The game will display the winner or a draw when the game ends.
The source code is organized as follows:
tic_tac_toe.c
: Contains the main game logic, including the game loop, input handling, game state management, and AI decision making.README.md
: Provides an overview of the game and instructions for building and running the code.
This project is released under the MIT License. See the LICENSE file for more details.
- AI difficulty selection option (Easy, Medium, Hard)
- Game statistics tracking (wins, losses, draws)
- Game board size selection option (3x3, 4x4, 5x5)
- Option to display game board size (3x3, 4x4, 5x5)
- Game messages and formatting improvements
- Provide localization support for multiple languages
- Optimize the codebase further for better performance
- The Minimax algorithm implementation is based on the tutorial by GeeksforGeeks.
For any questions or inquiries, please contact the project author:
- Name: Gyeongtae Kim
- Email: [email protected]