Eight-Puzzle Game
This is a JavaScript implementation of the classic 8-puzzle game. I’ve also built in an AI to solve the puzzle if you are stuck.
Features
- Uses the A* algorithm to find the shortest way to solve the puzzle
- You can choose any image to show in the tiles. It will replace the numbers though.
- The blank tile can also be controlled using hand gestures. It was trained using supervised learning on a custom dataset of over 5000 photos (all the photos are of me showing my hand to the camera 😄).
Controls
↑← ↓ →
Arrow keys
✋👈 👇 👉
Hand Gestures (using camera)
WA S D
Keyboard keys
Game
Code
Here’s the code for A* path finding algorithm that solves the puzzle: