Skip to content

AP-Atul/SnakeAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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