u/joefluxin r/programming • Recommends
On “AI algorithm of snake game. Share opinions if you have interests!”
…05/02/nokia-6110/
I basically write an (almost) perfect AI by following a hamilitonian circuit, but allowing the snake to take shortcuts in that circuit. Here's a picture of what i mean:
https://johnflux.files.wordpress.com/2015/05/maze-layout.png
Here's it running inside a Nokia 6110 case, using the original screen, but on an arduino board:
link to this video
And here is a complete run, running on the PC: link to this video
And here's another video:
link to this video
See the top link for a full write up, source code, etc.
Just to add, the entire thing, including code to drive the LCD and do the graphics and the AI etc, requires 1.4KB of memory :-)…