Better Programming

Advice for programmers.

Follow publication

Member-only story

Build Mazes With SwiftUI

Mark Lucking
Better Programming
Published in
5 min readJun 14, 2021

Maze
Photo by Tobias Rademacher on Unsplash.

I was looking through The Pragmatic Programmers’ bookshelf for weekend reading and stumbled across Mazes for Programmers by Jamis Buck. As I read the description (“Remember when programming used to fun?”), something clicked inside me. Yes, I recalled it is fun, but then I realised the code illustrating the algorithms was using Ruby, a Python-like language I don’t know very well.

As I looked through the book, all the algorithms are described as well illustrated in code. I decided to try to rewrite them in Swift.

Just before I jumped in with both feet, I made a backup plan and did some quick research. You can seemingly embed Ruby within Swift (the technique outlined in this article “Swift & Ruby Interoperability” by Marcio Klepacz). I contemplated using such wizardry for a moment, but being a purist at heart, I decided to take the long road. The fun one.

Before I start, I want to give a quick nod to Jamis, who helped out a little with this article.

Programming Mazes

To the book then. It tells you how to build mazes and describes the algorithms required to do so. Jamis covers a half-dozen ways to build ever more complex mazes and more…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Mark Lucking
Mark Lucking

Written by Mark Lucking

Coding for 35+ years, enjoying using and learning Swift/iOS development. Writer @ Better Programming, @The StartUp, @Mac O’Clock, Level Up Coding & More

Write a response