Skip to content

SmithLth/SnakeDijkstraAI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake AI with Dijkstra's Algorithm

This repository accompanies this video: https://www.youtube.com/watch?v=BCpKJrGHBJA

Specifically it's implementing this algorithm: https://github.com/chuyangliu/snake/blob/master/docs/algorithms.md#greedy-solver, the only difference being that in step 1, Dijkstra's algorithm was used to compute the shortest path. There the longest path algorithm is also explained.

The three main files with all of the logic are Controller.pde, SnakeDijkstraAI.pde and Snake.pde.

To run this project it is only necessary to have Processing installed, then clone or download this repository, open in Processing the folder where it's located and then just run it.

alt text

In the image it's being executed in VS Code, but it works equally well in Processing. I've commented it (in spanish) as well as I could. It's a bit disorganized however because I just wanted to finish it fast.

About

Snake game implementation with AI that uses Dijkstra's algorithm, in Processing/Java.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Processing 58.1%
  • Java 41.9%