Search⌘ K
AI Features

Introducing Our Basic Grid

Explore the foundational grid and cell classes used to generate mazes programmatically. Understand how to instantiate grids, link cells bidirectionally, and apply maze algorithms. Learn methods to display mazes as ASCII art and graphics, enabling you to build flexible maze structures for further expansion.

Taking off

Doodling mazes on paper is fine and all, but if that’s all we had, we’d never get anything done. We’re computer programmers. Let’s do this right.

Let’s have the computer do it for us.

Since grids are the foundation of most of what comes later, we’ll start there, exploring the particular implementation used throughout the course. We’ll see how it works in practice by implementing the Binary Tree and Sidewinder algorithms on top of it, and we’ll work through two different ways to display it, textually (think “ASCII art”) and graphically.

Basic grid

The starting examples will all build on one particular grid implementation, so we’ll explore it here. This will be the tool we’ll use to build out our mazes, either by using this Grid class directly or by ...