Skip to Main Content
Mazes for Programmers
book

Mazes for Programmers

by Jamis Buck
July 2015
Intermediate to advanced content levelIntermediate to advanced
286 pages
6h 31m
English
Pragmatic Bookshelf
Content preview from Mazes for Programmers

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:

images/polar-to-sphere.png

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, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Exercises for Programmers

Exercises for Programmers

Brian P. Hogan

Publisher Resources

ISBN: 9781680501315Errata Page