#427 · Primary category: Education & Research
snake
Playing the game of snake with AI.
Project last updated:04/19/26
GitHub Stars
1.8K
Forks
579
Contributors
4
License
MIT
Why we included this project
Here is a compact Python project that makes it easy to see two very different ways of playing snake side by side. One agent treats the game grid as a graph and plans its moves using shortest paths and Hamiltonian cycles, adding detours when it needs to avoid cornering itself. The other is a Double DQN agent trained in PyTorch, which learns purely from rewards with no hand-coded strategy. The two implementations are cleanly separated in the codebase, so you can study either approach on its own. Because the environment is a small 6x6 grid and a pretrained model is included, it also works well as a hands-on introduction to Q-learning and DQN training loops.
Articles for this project
No articles for this project yet.
To suggest a topic or contribute an article, contact us.
Related projects in this category
prompts.chat
f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.
JavaGuide
Java Interview & Backend General Interview Guide, covering computer fundamentals, databases, distributed systems, high concurrency, system design, and AI application development.
system-prompts-and-models-of-ai-tools
A curated collection of system prompts, internal tools, and AI models from popular AI assistants and coding agents.
30-seconds-of-code
Coding articles to level up your development skills
generative-ai-for-beginners
21 Lessons, Get Started Building with Generative AI