Welcome to Tic-Tac-Toe: Hell on Earth, a simple yet fiendishly challenging console-based Tic-Tac-Toe game written in C++. The game features a relentless AI opponent that is designed to be unbeatable, making this a test of your wits, patience, and perhaps your sanity!
The game follows the traditional rules of Tic-Tac-Toe:
- The game board is a 3x3 grid, represented in the console as shown below:
|---|---|---| | 1 | 2 | 3 | |-----------| | 4 | 5 | 6 | |-----------| | 7 | 8 | 9 | |---|---|---| - Players take turns to place their mark (X) on the board by entering the number corresponding to the desired position (1-9).
- The AI opponent, represented by (O), will then take its turn.
- The game continues until the board is full, ending either in a draw or with the AI claiming victory.
The AI in this game is programmed to be invincible. It's so challenging that the difficulty level is aptly named "Hell on Earth". No matter how clever you think you are, the AI will always find a way to avoid defeat. The best outcome you can hope for is a draw.
- Console-Based Interface: The game runs entirely in the console, making it lightweight and easy to play on any system with a C++ compiler.
- AI Opponent: The AI is built to never lose, ensuring a consistent and formidable challenge.
- Single Difficulty Level: The game only offers one difficulty level, "Hell on Earth," reflecting the impossibility of defeating the AI.
To run this game, you will need:
- A C++ compiler (e.g., g++, clang++)
- A terminal or command prompt
- Clone this repository:
git clone https://github.com/dirDahsul/Tic-Tac-Toe-Hell-On-Earth-Difficulty.git
- Navigate to the project directory:
cd Tic-Tac-Toe-Hell-On-Earth-Difficulty - Compile the game:
g++ -o tictactoe Tic-Tac-Toe.cpp
- Run the game:
./tictactoe
Alternatively just use Visual Studio to compile and run the project
After launching the game, the Tic-Tac-Toe board will be displayed in the console. To make a move, enter the number corresponding to the position on the board where you want to place your X. The AI will then take its turn, placing an O on the board. The game alternates turns until either a draw occurs, or the AI wins.
This game is designed purely for fun and as a programming exercise. The AI is intentionally made to be unbeatable, and no known strategy can defeat it.
This project was created as a simple and fun challenge, but potential future enhancements could include:
- Adding different difficulty levels (but what fun would that be)
- Implementing a two-player mode (user makes turn instead of AI)
- Adding a graphical user interface (GUI)
This project is open-source and available under the GPL-3.0 License. See the LICENSE file for more details.
Thank you for checking out Tic-Tac-Toe: Hell on Earth! Test your skills and see if you can at least force a draw against the AI.