-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|41|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Generators


 
Pakz
Created : 28 October 2021
Edited : 28 October 2021
Language : Lua - codea(ios)

L Systems - plant

L systems - string with turtle instructions

Latest Update



This from the Nature of Code book(free online)

It is a system to draw things from a string that contains turtle instructions. You start with a string with say the character "F" By continiously replacing this character F with new set of characters you build a string that draws a plant like drawing.

Look at the code at the instructions that are in this example.

The pop and push matrix are used to store the current drawing location and to restore to the previous drawing location. I think this code actually tought me how these things like translate and rotate and popmatrix work.

I wil add a screenshot soon. On iphone right now.

 

Comments


Thursday, 28 October 2021, 08:16
rockford
Looks pretty good
Thursday, 28 October 2021, 08:31
Jayenkai
It's a lovely generator!
Thursday, 28 October 2021, 08:35
Pakz
On the nature of code book site there are links to more of those build string formula's. This L Systems were invented in the 70s or so and thus have a lot of documentation. It is in the fractals chapter.