Please Forward: Ruby Quiz Submission

From: "Justin Ethier" <>
Date: May 29, 2007 12:42:14 PM CDT
Subject: Please Forward: Ruby Quiz Submission

Hello Everyone,

Here are links to the code for my solution:

Basically there are 2 parts to it. The first one takes the depth level and base fractal shape, and recursively creates a list of directions that can be traced to draw the fractal. For example, the fractal at level 1 is defined as:

[0, 90, 0, 270, 0] also written as [Right, Up, Right, Down, Right]

The second part creates an RMagick canvas and traces out each line one-at-a-time to draw the actual fractal.
There are probably more efficient ways of doing this, but this approach works well at lower levels.




Begin forwarded message: