mazerunnerAI
A LITTLE DIRECTION

Meet your maze.

Part game. Part experiment. Entirely your playground.

01 / GENERATE

Make the challenge yours.

Choose a grid from 15 × 15 to 51 × 51. Hard mazes twist through deep corridors; Expert picks the longest route from three candidates. Easy favors straighter corridors.

Triggers & gates adds an amber key and a locked edge. Visit the key before crossing the gate. Every generated maze is solvable, and each roll is saved to My lab. All twists default to off. Black holes end a run when entered; a safe route always exists. Multi-trip mode requires 2 or 3 visits to the exit, returning to start between them. Fog of war reveals cells around your position and your explored trail; planners still know the full map.

02 / SOLVE

Choose a different mind.

A* prioritizes distance plus cost. Breadth-first search spreads in waves. Dijkstra explores the cheapest states first (equivalent to BFS on this unweighted grid). All three find a shortest legal route.

Depth-first search explores a branch before backtracking. It may take a longer route. Complete searches track the trigger and multi-trip leg. Try greedy best-first, weighted A*, beam search, random walking, greedy walking, left/right wall followers, and a least-visited explorer. Weak methods may loop, exhaust their budget, or enter black holes. Their failures are part of the lesson. Use Manual to play with arrow keys, WASD, or the touch controls.

YOUR CODE / MAZESCRIPT

Small instructions. Big ideas.

Write one instruction per line: N, E, S, W move one cell. RIGHT and LEFT take one wall-following step, initially facing east. Walls block movement.

REPEAT 10000
  RIGHT
END

Repeat blocks can nest up to 8 levels and expand to at most 100,000 operations. Comments start with #. Use FORWARD or BACK relative to your heading; TURN LEFT / TURN RIGHT only rotates. IF OPEN FRONT (or N/E/S/W/LEFT/RIGHT/BACK), IF UNVISITED direction, IF KEY, IF DEADEND, IF AT START, and IF AT EXIT choose a block; ELSE is optional, END closes it. RANDOM, GREEDY, and EXPLORE choose a move. THINK pauses for one instruction, MARK records your cell, STOP ends the program. PLAN BFS / A* / DFS / GREEDY invokes a planner from your current state. All programs have a 100,000-instruction budget. Load the 11 annotated examples in Your code, then change a rule and compare.

NEURAL / EXPERIMENT

Teach a tiny network.

A hybrid policy runs in your browser: an 8 → 12 → 4 dense network plus learned state-action memory. Inputs include position, target direction, legal moves, exact cell identity, and trigger state. Outputs are the four movement choices. Memory lets it represent complex maze routes that a tiny dense network cannot.

Dense training adjusts 160 weights using backpropagation. The memory head learns state-action values through reward updates; guided mode also fits expert actions. Tune rewards for legal moves, new cells, leaving dead ends, triggers, and the exit, plus penalties for walls and revisits. Exploration-only learning can still loop or fail. There is no hidden algorithm fallback. Choose this maze’s expert route or a mixed set of your last five mazes, then tune reward, penalty, and learning rate. Checkpoints automatically preserve younger and older brains, weights, curriculum, and learning history. The Neural Observatory visualizes activations, action probabilities, confidence over time, and a Sankey diagram of choices. Compare checkpoint accuracy on the current maze and run each brain to test its actual behavior.

03 / RESULTS

Make your next run better.

Completed paths are replayed by the server, including gate rules. Scores reward shorter paths and faster completion, scaled by grid size. Pauses and animations count toward elapsed time.

Publish as ANON or use up to four letters or numbers. Every result includes a generated solve thumbnail. Filter the board by runner for a more useful comparison.

STAY A WHILE

Your own corner of the lab.

Guest profiles save your work for 30 days on this browser. Create an account to return from another device; registering keeps your guest experiments. Logging into another account switches libraries.

Tap the music note for a procedural ambient drone, soft noise, and playful solver sounds. Audio starts only after a tap. Fullscreen and touch movement are available on supported tablets.

Enter the playground →

Algorithm field guide