Welcome to the NaC Game Bot repository! This project is a simple yet engaging implementation of the classic game Tic-Tac-Toe (Крестики-нолики) using the Aiogram framework for Telegram bots. Dive into the world of game development with Python and explore the functionality of a bot that can play against users using the Minimax algorithm.
- Features
- Installation
- Usage
- Game Rules
- Minimax Algorithm
- Technologies Used
- Contributing
- License
- Releases
- Play Tic-Tac-Toe against the bot.
- Uses the Minimax algorithm for optimal play.
- Simple setup and easy to use.
- Built with Python and Aiogram for seamless integration with Telegram.
To get started with the NaC Game Bot, follow these steps:
-
Clone the repository:
git clone https://github.com/yewonnie/NaC_Game_Bot.git
-
Navigate to the project directory:
cd NaC_Game_Bot
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up your Telegram bot token. You can obtain a token by talking to BotFather on Telegram.
-
Create a
.env
file in the project root and add your token:TELEGRAM_TOKEN=your_bot_token_here
To run the bot, execute the following command in your terminal:
python main.py
Now, open Telegram, search for your bot, and start playing Tic-Tac-Toe!
The rules of Tic-Tac-Toe are simple:
- The game is played on a 3x3 grid.
- Players take turns placing their marks (X or O) in empty squares.
- The first player to get three of their marks in a row (horizontally, vertically, or diagonally) wins.
- If all squares are filled and no player has three in a row, the game ends in a draw.
The Minimax algorithm is a decision-making algorithm used in game theory. It provides an optimal move for the player assuming that the opponent also plays optimally. The algorithm evaluates all possible moves and chooses the one that maximizes the player's chances of winning while minimizing the opponent's chances.
- Tree Structure: The algorithm builds a tree of possible game states.
- Recursion: It recursively evaluates each state to determine the best possible outcome.
- Backtracking: It backtracks to find the optimal move based on the evaluations of future states.
This algorithm ensures that the bot plays optimally, making it a challenging opponent.
- Python: The programming language used for this project.
- Aiogram: A modern and easy-to-use framework for building Telegram bots.
- SQLite3: A lightweight database for storing game data.
- Git: For version control and collaboration.
Contributions are welcome! If you would like to contribute to the NaC Game Bot, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature
- Make your changes and commit them:
git commit -m "Add your feature description"
- Push to the branch:
git push origin feature/YourFeature
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
You can find the latest releases of the NaC Game Bot here. Download and execute the files to get the latest features and improvements.
Feel free to explore the "Releases" section for updates and new versions.
For any questions or feedback, feel free to reach out. You can open an issue in the repository or contact me directly through my Telegram.
Enjoy playing Tic-Tac-Toe with the NaC Game Bot! Have fun and may the best player win!