Hard⏱ time3 hr$ cost0
Self-Playing Snake
Give the snake game a simple AI that chases food and avoids walls on its own.
Start building ↓
Result first
The build
Step 01
Build the game
Make a basic snake game.
Step 02
Add a goal
Locate the food each step.
Step 03
Plan a path
Steer toward food while avoiding the body.
Step 04
Auto-play
Let the AI run the snake.
Working Principle
Each step the AI picks the direction that moves toward the food without hitting a wall or its own body.
The science behind it
A closer look
It's greedy pathfinding; smarter versions use search (like BFS) to avoid trapping themselves.
Take it further
Variables to test
- 1 Upgrade to BFS pathfinding — fewer deaths?
- 2 How long a snake can it survive?
More AI
AI
Hand-Drawn Digit Classifier
Train a tiny neural network in the browser to recognise digits you draw with a mouse.
Medium⏱2 hr$0
AI
Rock-Paper-Scissors Vision
Use a webcam and a no-code model to recognise your hand and play rock-paper-scissors.
Easy⏱1 hr$0
AI
Spam Email Classifier
Train a model on example messages so it can flag new ones as spam or not.
Medium⏱2 hr$0