An open API service indexing awesome lists of open source software.

https://github.com/omarazizi/snake-ai

AI agent that plays snake game in C
https://github.com/omarazizi/snake-ai

Last synced: 8 months ago
JSON representation

AI agent that plays snake game in C

Awesome Lists containing this project

README

          

# Snake-AI
![C](https://img.shields.io/badge/c-%2300599C.svg?style=for-the-badge&logo=c&logoColor=white)

This AI plays the snake game I made earlier. The learning technique I used is [Reinforcement Learning](https://en.wikipedia.org/wiki/Reinforcement_learning), or in other words, Reward Learning, where the AI agent receives a penalty for doing something wrong and a reward for doing something right.

### Testing the AI Agent
This is a sped-up version for the agent playing the game, where the score in green is the current one, and the score in yellow is the highest achieved.

https://github.com/OmarAzizi/Snake-AI/assets/110500643/7a75d319-7c02-475b-8573-d5438b057168

### Clone and Run
```bash
git clone https://github.com/OmarAzizi/Snake-AI.git && cd Snake-AI
```

To build and run the project
```bash
make && ./snake
```