This repo is a modification of the SnakeGame(https://github.com/ankita0018/SnakeGame) repo, where I'm implementing an AI to play the game.
Game can be played here: https://ankita0018.github.io/SnakeGame-AI/
A math based snake game, additional to the classical snake game.
You have a question based on divisibility of a number, and the answer lies in one of the 3 apples on the map, which is to be consumed by the snake.
Rules:
- If the snake consumes the right apple, it increments your score, while consuming the wrong one decrements it.
- Everytime the snake consumes an apple, it's length increases by one and it's speed increases.
- Colliding with the rocky boundaries of the field or the obstruction (rock) in the field leads to an instant loss.
- 3 lives are given initially, consuming the wrong apple more than 3 times leads to a loss.
AI Implementation
- The snake successfully finds the shortest path, using the Breadth First Search(BFS), to the right apple.
- AI at times makes stupid decisions, traps itself in an attempt to eat an apple, which leads to it colliding with its body.
- AI search algorithm is to be implemented, using a good hands-on approach to reduce the number of computations, and to make sure the AI does not trap itself.
- Neural Network implementation is to be done too, using a genetic algorithm, spawning several generations of snakes and independently training/dumping them.
- BFS AI easily goes upto 100.