Skip to content

ap-atul/SnakeAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

abf2f82 · Jan 30, 2021

History

10 Commits
Nov 6, 2020
Nov 5, 2020
Nov 5, 2020
Nov 9, 2020
Nov 11, 2020
Nov 11, 2020
Jan 30, 2021
Nov 11, 2020

Repository files navigation

SnakeAI

AI for Snake game using A star algorithm.

Works right in the terminal. Uses Astar to find the route

Astar: 
    fn = gn+ hn
        here,
            gn is the total moves taken for a food
            hn is the manhattan distance

Customize the game values with the constant.py file

Execution

  1. Clone the repo
$ https://github.com/AP-Atul/SnakeAI.git
  1. Install the curses package
$ pip install curses
  1. Run the main file in the terminal
$ python main.py

Screen

screen