Maze etc.

Amorphous Maze v 5.10

I wrote mathematical functions that generate continuous and closed irregular-shaped curves and used them to set the outer boundaries of the maze in the Amorphous Maze program I had written previously. This resulted in more interesting looking mazes compared to those with rectangular outlines. If you want to learn more, please view this video.

amorphousmaze 5.10

Eight Way Maze 2013/07/07

I decided to write a maze drawing program where the paths extend in eight directions. So I first designed the appearance with a free CAD program, as I did with Beads Maze, a program I wrote about 2 weeks ago.

eight way maze cad drawing

Next I wrote the low level display routine, which draws the paths according to the internal connectivity. At first I was planning to round the center bends, but I decided to leave the corners pointy for simplicity. I also wrote a test page in PHP that increments a counter each time I click on a button. Since there are 256 patterns to test, this really came in handy while debugging my code. At one point it showed me that a trim intersection function I wrote was fundamentally flawed. I spent a whole day rewriting it.

eight way maze cell pattern

The final step was to cut and paste a maze generating code I wrote before and tailor it to this one. This step wasn't too difficult except for a perplexing bug -- it was not until I broke up a long conditional expression into many small steps that I realized that in PHP, == has a higher precedence than &. I wonder if I'm the only person who finds it counterintuitive that a bitwise AND operation is performed after equality comparison.

eight way maze final image

Above image is the final result. All in all, there were places in the code that felt heavy and laborious but chipping away on it every day eventually got me to the finish. Here is the link to the Eight Way Maze program.


About this page

Beads Maze 2013/06/21

I decided to write a maze drawing program with cells shaped like donuts. So I first designed the appearance with a free CAD program. I like to start my projects with a very solid visual design because (1) appearance is important, especially in games, (2) I will have a point of reference while coding, and (3) a detailed picture may even suggest a new way to play the game.

cad

Next I wrote the so-called OnDraw routine for an empty maze in PHP. When it comes to developing games, I like the bottom-up approach. I like to jump right into coding, get instant feedback, and design as I code. And I run IIS locally so that I don't have to upload my code to a remote server each time I make a code change. I also rely heavily on error_reporting(E_ALL); and error_log("x=$x\n",3,"output.txt"); for debugging.

blank rings

Next I retrofitted an old maze drawing program for a square maze I wrote quite some time ago over the donut rings. This step took much longer than I anticipated for many reasons, one of which was that I could not comprehend it because almost all variables were single letter alphabets. My bad.

overlay

Then I constructed the walls inside the donuts based on the square maze. I was also trying to pick a good color for the walls. While visualizing what it would look like if every donut had a different color, I got the idea that I should call it beads maze. 

numbers

While staring at the numbers I printed inside the small circles for debugging purpose, a great idea hit me -- why not show alphabets instead of numbers? When a player solves the maze properly, the letters he or she has visited will spell out a word or a sentence containing a secret message. What serendipity!

final beads maze

Above is what the final program looks like. Please visit http://www.puz.com/sw/phpmaze/index.php and try it out!

Screenshots

Robot University
More screenshots (external).

20 Hops Skelton.
User can click anywhere.

20 Hops Skelton with rules.
Only white cells are clickable.

V 1.00 running
on Smartphone.

  

20 Hops v1.04 has hints.

20 Hops status report

Downloads

Links

Last edit 08/19/2014