Maze Generator & Solver

Random maze generation with player movement or auto-solve button

Moves

0

Status

Playing

Maze

Use arrow keys or WASD to move. Reach the green goal!

About Maze Generator & Solver

How to Play

  • Use arrow keys (↑ ↓ ← β†’) or WASD keys to move
  • Start at the green square in the top-left corner
  • Navigate through the maze to reach the goal (bottom-right)
  • You cannot move through walls
  • Try to complete the maze in the fewest moves possible

Features

  • Random maze generation using recursive backtracking
  • Keyboard controls (Arrow keys or WASD)
  • Auto-solve feature with pathfinding algorithm
  • Move counter to track efficiency
  • Visual solution path display
  • 15Γ—15 grid size for challenging gameplay
  • Beautiful SVG-based maze rendering

Algorithm

The maze is generated using the Recursive Backtracking algorithm, which creates a perfect maze (one solution, no loops). The auto-solve feature uses Breadth-First Search (BFS) to find the shortest path from start to finish.

Tips

  • Try to visualize the path before moving
  • Use the auto-solve to learn optimal paths
  • Generate new mazes for endless variety
  • Challenge yourself to beat your move count
  • Perfect mazes always have exactly one solution