The task for this lab was to create methods for a class that allows the user to set different components of L-systems. The class allows the user to set the values of the L-system fields, set the number of iterations, set the distance for the L-system, and set the angle for the L-system. The user can also access the distance, and angle fields. After creating the class the task was to create a drawing using three different l-systems.
The L-system object contains the baseString, rules, iterations, angle, and distance fields. The baseString field holds a string. The rules field holds a list of a list. The iterations field holds an integer, and both the distance and angle fields hold floats.
For my final scene I set the L-system fields, then used moved the turtle using the up, goto and down functions. Then I reset the heading, and then drew the plant using the process string function. I repeated this six times, one for each of the plants.
BaseString:F
Rules:[['F','F[+F]F[-F]F']]
Iterations:5
Angle:23.5
Distance:1.75
BaseString:F
Rules:[['F', 'fF[+FL]F[-FL][FL]']]
Iterations:4
Angle:22.5
Distance:2.5
BaseString:F
Rules:[['F', 'fF[+FL]F[-FL][FL]']]
Iterations:4
Angle:22.5
Distance:7
BaseString:F
Rules:[['F','F[+F]F[-F][F]']]
Iterations:5
Angle:20
Distance:7
BaseString:F
Rules:[['F','F[+F]F[-F]F']]
Iterations:5
Angle:23.5
Distance:1.9
BaseString:F
Rules:[['F', 'fF[+FL]F[-FL][FL]']]
Iterations:4
Angle:22.5
Distance:3.5