Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 2.09 KB

README.md

File metadata and controls

58 lines (38 loc) · 2.09 KB

Snake

This project focuses on the artificial intelligence of the Snake game. The snake's goal is to eat the food continuously and fill the map with its bodies ASAP. The old version of this project is written in C++. Now it has been rewritten using Python for a user-friendly GUI and the simplicity in the implementations of algorithms.

Algorithm Details >

Experiments

We use two metrics to evaluate the performance of an AI:

  1. Success Rate: Rate of success (i.e., the map is filled with the snake's bodies) after playing the game for N times.
  2. Average Steps: Average steps the snake has taken to success.

Test results (N=1000):

Solver Demo Success Rate Average Steps
Hamilton 100.0% 1776
Greedy 27.4% 1575

Installation

Requirements: Python 3.5+ with Tkinter installed.

$ pip3 install -r requirements.txt
$ python3 run.py

Run unit tests:

$ python3 -m pytest -v

License

See the LICENSE file for license rights and limitations.