by VanessaE » Fri Oct 04, 2013 23:08
Most elementary way I can think of:
Imagine you're in a futuristic skywriting ship. You start out pointing straight up with your plane's tail sitting on the ground. You have totally free movement, zero gravity, zero wind, and really good inertial dampeners. ;-)
You're given a list of movements to draw a pattern in the sky, each entry consisting of a single letter telling you how to turn and move, and what buttons to press on your console. Your list has exactly 5 pages, but some of pages 2 through 4 might be completely blank.
You start reading and performing the maneuvers written on page 1 - this is your axiom page. At the top of the axiom page is "angle: m degrees" and "max. n iterations" with some small values of m and n, say 10 and 3.
You can move forward in 1 meter steps and you can adjust your yaw, pitch, and roll in small but fixed increments of the above angle amount, and you have three colors of smoke at your disposal.
The f, T, and R are the smoke colors; F uses f's color and causes the plane to make a large puff of color T when the smoke turns off. Each letter moves you forward one meter and emits that color of smoke. G moves forward one meter without leaving any smoke.
Each use of [ means you need to write down a bookmark somewhere of your current position and heading and then continue with the stated maneuvers. Each use of ] means to turn off your smoke (and leave a puff of T if you had F turned on), teleport back and reset your heading to whatever the last bookmark says, and erase that bookmark from the list. You'll always step backward through the list of bookmarks.
Each use of A through D (capitals) means to flip to one of pages 2 through 5, respectively, and perform the maneuvers written there. At the end of the page, flip back to the page you were just on, and continue from where you left off.
Each use of a through d (lower case) means to flip to one of pages 2 through 5, and roll a pair of dice. If you get a number greater than the page number you just flipped to, execute the maneuvers on that page. Otherwise, just go back to where you were before and continue performing your maneuvers.
Recursion:
If you flipped to one of those four pages, and you found a spot where it says to flip to some other page (say page 2, "A", says to go to page 4, "C"), do so and start executing the instructions there. Then go back to the page you were just on and proceed with the next instruction.
If you keep flipping back to the start of the page you're already on (e.g. page 3 keeps instructing you to go to page 3), keep a count of how many times you did that. Each of the four rules pages gets its own counter. If you reach a spot that says to jump back to the same page, and you've exceeded "n iterations" for this page, reset yur count to 0, ignore the jump and just continue with the next instruction. When you're done with this page, flip back to the page that sent you here and pick up where you left off.
Eventually you'll end up back on page 1. Continue executing your maneuvers until you finally get to the end of page 1. Stop moving and turn off your smoke.
Imagine that for any cubic meter of air that has smoke, that whole cubic meter is filled completely with the smoke. Now, translate the colors into node names for trunks (F/f), leaves (T) and fruit (R).