SnakeAI is a Python project that allows an AI agent to play the classic game of Snake. The project uses a neural network model to make decisions for the snake, allowing it to navigate the game board and collect food without crashing into walls or its own tail.
To use SnakeAI, you'll need to have Python 3 installed on your computer. You'll also need to install the Pygame library, which can be done using pip:
pip install -r requirements.txt
You will also need PyTorch and its libraries :
https://pytorch.org/get-started/locally/
Once you have Python and Pygame installed, you can clone the SnakeAI repository to your local machine:
git clone https://github.com/Zciwolvo/snakeAI.git
To run the SnakeAI game, navigate to the project directory and run the snake.py
file:
cd snakeAI
python GamePT.py
The game will start automatically, and the AI agent will begin playing. You can watch the game progress on the screen, and you can use the arrow keys to control the speed of the game.
If you'd like to contribute to the SnakeAI project, feel free to submit a pull request with your changes. We welcome contributions from the community and are always looking for ways to improve the project.
SnakeAI is licensed under the MIT License. See the LICENSE
file for more information.