← All builds
Example. Example entry, not a real project. It shows what a project page will look like.
Snake, but the snake learns
A classic snake game where a tiny AI tries to play by itself and gets a little better every round.
The idea
What if the snake played itself? I started with a normal snake game, then added a simple brain that remembers which moves got it killed.
How it works
- The game draws on a canvas, 20 × 20 squares
- Every move, the snake looks at what is next to it
- If a move ended the game before, it gets a lower score next time
After about 200 rounds it stops crashing into walls. It still eats its own tail a lot.
What I learned
Computers don't "understand" the game. They just keep score of what worked. That was surprising.