Cell is a Swift enumeration for the contents of one maze location. Its Character raw values make maze grids easy to print while distinguishing empty, blocked, start, goal, and path locations. section 2.2
A maze uses these Cell cases:
- Empty (`O`) marks a traversable space. section 2.2
- Blocked (`X`) marks a wall that successor generation cannot enter. section 2.2
- Start (`S`), Goal (`G`), and Path (`P`) support displaying a solved maze. section 2.2
// A Cell represents the status of a grid location in the maze
enum Cell: Character {
case Empty = "O"
case Blocked = "X"
case Start = "S"
case Goal = "G"
case Path = "P"
}
typealias Maze = [[Cell]]
Use the compact enum and Maze type definition to see how cell states become a printable two-dimensional grid. section 2.2
