SkillAgentSearch skills...

SnakeDijkstraAI

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

Install / Use

/learn @CamGomezDev/SnakeDijkstraAI
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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.

View on GitHub
GitHub Stars6
CategoryDevelopment
Updated11mo ago
Forks3

Languages

Processing

Security Score

62/100

Audited on May 8, 2025

No findings