ScratchData LogoScratchData
Back to getbent's profile

L-system Plants

GEgetbent•Created December 6, 2021
L-system Plants
67
42
362 views
View on Scratch

Instructions

Click the flag to generate a semi-random plant! In my coding class we recently did a project on L-systems, and I thought it was really cool - so cool that I did my best to recreate it in Scratch! For every "generation" of the program, each character of the currentString is: - acted upon (for example, an "F" causes the pen to move forward) - replaced, if it has a definition within the "grammar" (a given set of rules that defines a certain character as something else (for example, a rule in the grammar could be "F=FF" These patterns use recursion (the calling of functions from within themselves) to work - so I used clones to try and emulate the state of each function call! Check out the Wikipedia entry for L-systems: https://en.wikipedia.org/wiki/L-system This implementation is far from perfect - feel free to remix to improve it, or to create a new grammar! Enjoy :)

Project Details

Project ID612397918
CreatedDecember 6, 2021
Last ModifiedDecember 18, 2021
SharedDecember 18, 2021
Visibilityvisible
CommentsAllowed