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.
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.
