File:Screenshot.png

From OLPC
Revision as of 16:30, 19 March 2008 by Bjc (talk | contribs) (Simple recursion in Turtle Art. Recursive loop is handled in stack1, with final case of drawing a line. Stack two is used to orient the turtle between line segments. The control variable box1 is used to store total draw length (300 horizontal pixels in th)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Original file(1,200 × 900 pixels, file size: 115 KB, MIME type: image/png)

Simple recursion in Turtle Art. Recursive loop is handled in stack1, with final case of drawing a line. Stack two is used to orient the turtle between line segments. The control variable box1 is used to store total draw length (300 horizontal pixels in this case), multiplied by 4 to offset the division on the first draw in stack2. box2 is used to control recursion depth. Here it's set to 4, meaning we will subdivide the line 4 times.

The division and multiplication in stack2 is based on the number of stack1 calls. You need to divide by one per call, then later unwind by one per call. Since the snowflake is composed of 4 stack1 segments, the divisor/multiplicand is also 4.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current23:34, 31 August 2008Thumbnail for version as of 23:34, 31 August 20081,200 × 900 (115 KB)Kirkjerk (talk | contribs)Reverted to version as of 20:30, 19 March 2008
23:34, 31 August 2008Thumbnail for version as of 23:34, 31 August 20081,200 × 900 (14 KB)Kirkjerk (talk | contribs)
16:30, 19 March 2008Thumbnail for version as of 16:30, 19 March 20081,200 × 900 (115 KB)Bjc (talk | contribs)Simple recursion in Turtle Art. Recursive loop is handled in stack1, with final case of drawing a line. Stack two is used to orient the turtle between line segments. The control variable box1 is used to store total draw length (300 horizontal pixels in th

The following 2 pages link to this file: