This program implements an AI agent to play the Snake game. It includes functionality for both training the AI and allowing a player to play the game.
To train the AI, use the train.py script with the following command-line arguments:
''' python train.py --player [True/False] --cordinates [x,y] --optimization [True/False] --famine [True/False] --load_model [model_name.pth] --save_name [model_name.pth] --h [height] --w [width] --snake_count [number] --food_count [number] --win [True/False] '''
player: Specify if player mode is enabled.cordinates: Specify the coordinates in the format "x,y".optimization: Specify if optimization is enabled.famine: Specify if famine is enabled.load_model: Specify the model to load.save_name: Specify the name to save the model.h: Height of the screen.w: Width of the screen.snake_count: Number of snakes.food_count: Number of food items.win: Specify if win condition is enabled.
To play the game, run the make global and make global_run scripts. This will launch a GUI window where you can select the level to play.
Contains the implementation of the Snake AI agent.
Defines the neural network model used by the agent.
Contains configuration parameters for training.
Script for training the AI agent.
Script for playing the game using the trained AI agent.
List of required Python packages.
- The code includes both training and playing functionalities for the Snake game AI.
- The AI agent is trained using reinforcement learning techniques.
- The game can be played either manually by a player or using the trained AI agent.



