Blog
Skip to end of metadata
Go to start of metadata

This week the lab was a continuation of the exploration of L-Systems.

We used basically the same lsystem.py and turtle_interpreter.py files as last week, but this week we updated them to designate LSystem and TurtleInterpreter classes, as well as change the code to use dictionaries to store characters used to draw shapes and trees.

We also created a shapes.py file, which contained the classes for filled and unfilled shapes, all of which come from the mother Shape class. The shape class used the _init_ function to create fields using “self.”

The first picture is drawn by trees.py,  which was created by making a tree class which was also a stem from the Shape class. It is just a basic L-System drawing with different numbers of iterations:

Here are the shapes I created:

Here is a scene of a tv and lounge area, complete with pictures of plants.

And here is a 5x4 mosaic I drew. The mosaic function was just carefully placing different shapes inside a unfilled square:

During this project I learned about dictionaries, and their use in code. I also learned how to properly place print statements in my code to allow myself to find my errors as I go.

I worked with Stephanie and Kyle, as well as Luc, Maddie, and some TA’s.

Labels