Sphere Mazes
Creating a maze on the surface of a sphere shares a lot in common with creating a maze inside of a circle. This shouldn’t be surprising! A hemisphere, after all, is merely a circle that’s been lifted up by its origin, like this:
We can create a sphere by putting two hemispheres together, which means we ought to be able to implement a spherical grid by leaning on our polar grid (from Chapter 7, Going in Circles). We’ll need to change a lot of the calculations behind the measuring of the cells (a hemisphere may be related to a circle, but that doesn’t mean they wear the same size of shirt), and our to_png method is going to need rewriting, ...
Get Mazes for Programmers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.