A maze entrance is the designated starting position for traversal. In an image-based maze, it is a path pixel distinguished from walls, ordinary paths, and the treasure by a palette color. section 9.1 section 9.3.1
A Go maze solver handles the entrance by:
- Storing its RGBA color in a palette rather than relying on mutable global variables. section 9.3.1
- Scanning every pixel within the image bounds and comparing each pixel with the configured entrance color. section 9.3.1
- Returning the matching image.Point so traversal can begin from that coordinate. section 9.3.1
- Returning an error when no entrance pixel exists, allowing Solve to stop with contextual error information. section 9.3.1
Finding the starting coordinate
findEntrance walks rows and columns, checks maze.RGBAAt(col, row) against s.palette.entrance, and returns image.Point{X: col, Y: row}. section 9.3.1
Figure 9.3 Maze with entrance and next pixel
Visualizes the entrance together with the next pixel explored during maze traversal. section 9.3.1
