# Contextual Maze Generation

Loosely based off of the 10-print series.

The idea is that you have an empty grid which you raster over, filling in each cell based on its nearest neighbors. Because it is rastering, each cell has two nearest neighbors which have been defined. At each step, a limited number of choices will result based on what these nearest neighbors allow; of these options, one will be randomly selected and define/fill the current cell.

^{}

## Rastering

#### 6 Types of Walls

##### Rules

#Within the context of “maze formation” or “wall building”, let us suppose that you can build one of six (6) types of walls within each cell.

┗ ┏ ┓ ┛ ┃ ━

However, if a neighboring cell’s wall “ends” adjacent to the current cell then the current cell must “continue” that wall. And, unless ta particular neighbor is undefined (such as would happen along the edge if the grid is being rastered over), a cell cannot “begin” a new wall from the direction of that neighbor.

For example:

```
+--+--+--+
|┗|┓|a |
+--+--+--+
|┏|b | |
+--+--+--+
```

### 10 Types of Walls

##### Rules

#Within the context of “maze formation” or “wall building”, let us suppose that you can build one of ten (10) types of walls within each cell.

┗ ┏ ┓ ┛ ┃ ━ ┣ ┳ ┫ ┻

“Wall contunation” rules are same as above.

### 11 Types of Walls

##### Rules

#Within the context of “maze formation” or “wall building”, let us suppose that you can build one of eleven (11) types of walls within each cell.

┗ ┏ ┓ ┛ ┃ ━ ┣ ┳ ┫ ┻ ╋

“Wall contunation” rules are same as above.

## Non-Rastering

#NEED TO FIX – there is something wropn with the logic… it seems.

### 11 Types of Walls – Random Raster Asign (not growth off of seed)

##### Rules

#Within the context of “maze formation” or “wall building”, let us suppose that you can build one of eleven (11) types of walls within each cell.

┗ ┏ ┓ ┛ ┃ ━ ┣ ┳ ┫ ┻ ╋

Cells (i.e. positions on the grid) are randomly selected (from a heap) and randomly asigned a particular wall type. The options that are randomly chosen from are determined from that cell’s nearest neighbors. These options are calculated such that “walls must continue”.

This leaves the question: “Are there instances where it cannot make a choice?” I belive that the answer is “yes” as this non-rastering covering of the grid, alows for “loops” of cells to be filled leaving “wall endings” which are “surrounded”.

For example:

```
+--+--+--+--+--+
| | | |┛| |
+--+--+--+--+--+
| | | |a | |
+--+--+--+--+--+
| |┓| | | |
+--+--+--+--+--+
```

### 11 Types of Walls – Build off of seed

##### Rules

#Within the context of “maze formation” or “wall building”, let us suppose that you can build one of eleven (11) types of walls within each cell.

┗ ┏ ┓ ┛ ┃ ━ ┣ ┳ ┫ ┻ ╋

Cells (i.e. positions on the grid) are randomly selected (from a heap) and randomly asigned a particular wall type. The options that are randomly chosen from are determined from that cell’s nearest neighbors. These options are calculated such that “walls must continue”.

This leaves the question: “Are there instances where it cannot make a choice?” I belive that the answer is “yes” as this non-rastering covering of the grid, alows for “loops” of cells to be filled leaving “wall endings” which are “surrounded”.

For example:

```
+--+--+--+--+--+
| | | |┛| |
+--+--+--+--+--+
| | | |a | |
+--+--+--+--+--+
| |┓| | | |
+--+--+--+--+--+
```

### 11 Types of Walls – Build off of seed based on wall

##### Rules

#┗ ┏ ┓ ┛ ┃ ━ ┣ ┳ ┫ ┻ ╋

Cells (i.e. positions on the grid) are randomly selected (from a heap) and randomly asigned a particular wall type. The options that are randomly chosen from are determined from that cell’s nearest neighbors. These options are calculated such that “walls must continue”.

This leaves the question: “Are there instances where it cannot make a choice?” I belive that the answer is “yes” as this non-rastering covering of the grid, alows for “loops” of cells to be filled leaving “wall endings” which are “surrounded”.

For example:

```
+--+--+--+--+--+
| | | |┛| |
+--+--+--+--+--+
| | | |a | |
+--+--+--+--+--+
| |┓| | | |
+--+--+--+--+--+
```