Homework #10:
-
A copy of lsystem2.py was modified and renamed lsystem3.py. The set method was
modified to place the rules of the Lsystem in a dictionary. toString was updated
to print the rules. generateString was modified so that the keys in the dictionaries were read
and the replacement string was added to the local variable for the characters in the dictionary.
The write and read functions were changed to write and read the rules. A loop was created to draw
three trees.
-
A dictionary is different from a list in that it uses curled brackets instead of boxy brackets.
A dictionary uses keys to access information and a list uses numbers. This is appropriate for the task of identifying
the proper rule because each rule is a list of two strings of characters.
-
To create the final scene, the program identifies the lsystems provided as Lsystems, attatched them
to a list, and runs through the list to access the data and draw the trees. The Lsystems for the
trees are listed below.
-