Maze

0:00 Steps: 0

Arrow keys or WASD, or swipe

Back to Games

How to play

You start at the top left and the exit is the bottom right. Move with the arrow keys, with WASD, by swiping on the maze, or with the pad below it. Every maze is generated fresh and is a perfect maze, meaning there is exactly one route between any two points and no loops at all. Leave the trail on and your path is drawn behind you, which makes backtracking obvious. Turn it off if you want the harder version.

Tips

What makes a maze perfect

A perfect maze is one with no loops and no isolated sections: exactly one path between any two points. The mazes here are generated with an algorithm called recursive backtracking, which carves a passage by wandering randomly, only ever into unvisited cells, and backing up when it hits a dead end. The result is always perfect, and it tends to produce long winding corridors rather than a grid of short choices.

Perfect mazes have a useful property. Because there are no loops, following one wall with your hand from the entrance will always reach the exit eventually. It is slow, since it walks into every dead end on that side, but it cannot fail.

Getting out faster

-FAQ

Common questions

Is there always exactly one way out?

Yes. Every maze is a perfect maze with a single route between any two cells and no loops.

Does wall following always work?

In a perfect maze, yes. Keep one hand on the same wall and you reach the exit, though you visit every dead end on that side first.

What does the trail do?

It marks the cells you have visited so backtracking is obvious. Turn it off for the harder version.

-FAQ