This chapter covers
- Spinning up goroutines as needed
- Communicating between different goroutines
- Loading and writing a PNG image
- Manipulating images and colors using a Go library
- Writing a GIF image
- Using linked lists
The oldest representation of a maze found by archaeologists, from Paleolithic times, was engraved in a piece of mammoth ivory. In Indo-European mythology, mazes are often associated with engineers, such as Daedalus in Greece. Mazes are also used as a symbol for the difficult path of a life toward a god figure in the O’odham tradition in North America, in India in the Chakra-vyuha style, or in Europe on the floors of medieval churches to represent the way to salvation.
Solving a maze has been an interesting engineering exercise for ages, including physically with an autonomous robotic mouse (see micromouse competitions, e.g., https://ukmars.org/contests/micromouse/) or virtually using graph theory. There are countless algorithms, each optimized for different constraints: Are there loops? Is the target inside the maze, like a treasure, or on another side, like a liberating way out? Are there curves or only right-angled corners? In the case of multiple possible paths, do we need the shortest, the fastest, or the one that goes through a collection of bonus stars?