not finished
Mazes are cool, i've found trough intensive research. But how to represent them in code ?
what the maze ???
a maze is a mysterious place where you can get lost, but that's not helpfull to code one at all
topologically, a maze is a connected surface where you set 2 points : an entry and an exit
the shape of the surface will represent the complexity of the maze
traditionnaly, we organise them in a grid, but there could be another form.
Grid Mazes
I want to use as little data as possible to store a maze. To reprensent a maze, you could think of cells or of wall, lets start by walls :
We will store the south and east wall of each cell in a structure
struct Cell {
unsigned char east;
unsigned char south;
} typedef cell;
Because 1 cell takes up 2 bits, we will write code to pack 4 cells into 1 byte :