Tushar Lachman
Melbourne · RMIT ’27
ALGORITHMS IN C++RMIT · team of three

Maze Generation & Pathfinding in Minecraft

A maze you can walk through, which is a stricter problem than one you can print.

Programming Studio 2 · 2024
WHY IT EXISTS

A C++ program that builds mazes inside a running Minecraft world through the mcpp API and then helps a player find the way out again. The two halves are chosen to fit each other: Recursive Division carves the maze, and Wall Follower solves it. The same unit carried a separate LC-3 assembly component underneath.

How it’s put together

L00
C++
L01
mcpp
L02
Minecraft
L03
LC-3 assembly
L04
GCC
L05
Git

Built with

C++mcppMinecraftLC-3 assemblyGCCGit
PERIOD
Programming Studio 2 · 2024
ROLE
Team of three — shared implementation

The hard parts

07 NOTES
1

Recursive Division generates a perfect maze — the term of art for one with no loops, and exactly one path between any two cells — by repeatedly splitting the region with a wall and knocking a single gap in it.

2

Wall Follower solves it, and the pairing is the point rather than a coincidence: keeping one hand on the wall is guaranteed to reach the exit only when the maze is simply connected, which is exactly what Recursive Division produces. Add one loop to the maze and the same solver can circle inside it forever.

3

The maze is built in a real world rather than an empty grid, so the terrain is flattened first — the ground Minecraft supplies is not level, and a wall placed on a slope stops being a wall.

4

Construction is dynamic and three-dimensional through the mcpp API: the maze is placed into the live world as blocks, and a player walks the same structure the algorithm just generated.

5

Real-time pathfinding assistance for a player navigating the generated maze, rather than a solution printed once and left on screen.

6

The unit also required the same primitives written a level down, in LC-3 assembly — loops, branches, subroutines and memory operations built by hand, on a machine with no abstractions to borrow.

7

Built by three of us on GitHub. It is the earliest work on this site, and it is here because the algorithm choice is the kind of decision the later projects are made of.

Want the parts that aren’t on this page — the architecture arguments, the things that broke, a live walkthrough?

NEXTGlobal Food Loss Awareness — Data-Driven Web Application