Assignment 8
Skip to end of metadata
Go to start of metadata

For this assignment, we were asked to take our interpreter and Lsystem from last week's lab, and to modify them in order to create more trees.

Task one asked for us to create functions that would allow the turtle to be able to move around and be controlled. We created definitions for place, orient, and goto which told the turtle "pen" to move, set, and send the turtle different places.

The second task asked that we create the method _str_, which produces the base and rules of the string, calling it automatically when the object is printed. This produces:
base F
rule F->FF--F+F+F++F-F-F

The next three tasks had us create files named task1.py, task2.py, and finally task3.py which each set about producing the three required images.
task1
task2
task3

The task3 was the most fun to create, as it allowed us to modify our own lsystem, of which I took the treeF from ABOP, and changed the lsystem to make my own.
It changed from:
baseX
rule X?F-[X+X]+F+FX-X
rule F?FF

to

base X
rule X?FF-[FXF+FXF]+F+FFX-XF
rule F?FF

I learned how to use the _str_ function, as well as how to better understand lsystems and how they behave and what they are capable of doing. I really had fun modifying the lsystem and also creating a small forrest of trees, playing around with size, location, angle, and type of lsystem.

Labels