As part of my work at the State Library of NSW’s DX Lab we were overhauling the DX Lab website itself (as described here) and the opportunity came up to make an ‘interesting’ 404 page for the site. Assuming you aren’t reading this after the site has been changed again you will be able to see it here. But just in case, here is a video of it:

So how does it work? Why did I do it?

Let’s deal with why first and get to the fun, juciy code second. Growing up in the 1980s seems to have infected me with a love of pixellated, 8-bit aesthetics. My brother and I were lucky enough to have a Commodore 64 home computer and played many a game on its 320 x 200 pixel, 16 colour output. I got right into low-level coding on that machine, disassembling game code, reading hexadecimal and scribbling copious notes in exercise books to find out how things worked, subsequently writing my own demos.

It was a time of Rubik’s Cubes, Devo’s ‘Whip It’ on the radio and discovering fun mathematical curiosities like the colourful, crinkly-edged fractals of the Mandelbrot Set and the cellular automata of Conway’s Game of Life.

With these as influences percolating in the subconscious, I had just finished working on another arguably pointless (read: creative) part of the site refresh: the shuffling text of the titles. For them I had taken inspiration from ‘procedural’ graphic designer Andreas Gysin’s ingenius ASCII art shuffling animation. Poking around some of his older work I was enjoying the interactive, animated page headers, especially this one where where a series of blobs wander randomly under the title, leaving trails of various densities.

Somehow these wandering paths reminded me of mazes. Perhaps also because I had, at the suggestion of Seb Chan, finally got round to reading the awesome book 10 PRINT in which the authors:

“… consider randomness and regularity in computing and art, the maze in culture, the popular BASIC programming language, and the highly influential Commodore 64 computer.”

I felt there is a parallel between being lost in a maze and being lost on the web, which is of course how one ends up on a 404 page. So that is why I decided to do something maze-like for the page.


On to how, then.

I have always found mazes fascinating, especially the algorithms relating to creating and solving them, and so I started looking in to maze generation algorithms in more detail. I stumbled across this great page by Jamis Buck (who also has written this excellent book) which not only describes how a wide range of algorithms work, but also has live, in-page demos so one can see them in action. Have a read and ask yourself about what you have seen above. Can you guess how it works?

It wasn’t until I read the Wikipedia entry on Maze Generation Algorithms that I discovered, much to my a_maze_ment (no pun intended) that the algorithm for Conway’s Game of Life could be coaxed into making maze-like patterns by modifying its rule set slightly. This really blew my mind! Despite all my years of nerdy dabbling in coding, mazes, algorithms, Conway’s Game of Life, I had NEVER heard of this. What a glorious overlap; it was destiny!

#game-of-life #maze #404-page #8-bit #javascript #programming

How came to make an 8-bit inspired maze-like 404 page
1.55 GEEK