Due: , 11:59 pm

As with last week, the assignment is to bring together the lsystem and turtle interpreter classes to make a scene that consists of fractal shapes and trees. Your top-level program will import both the lsystem and interpreter modules. Unlike last week, however, your scene.py may not import the turtle module or make any calls to turtle commands directly. If you want to draw something, you have to pass a string to the interpreter drawString method. There will be no exceptions to that rule. (Note that you may attach arbitrary meaning to any character not used by an L-system grammar.)
colorstack.append( turtle.color()[0] )
Be sure to use the turtle.color() and turtle.width() methods properly. They are turtle functions, and the new color or new width needs to be an argument to the function.
Once you have made the modifications to drawString, try running systemFL using the classtest.py test function from the lab. You can also use the test function single.py to draw just a single tree.
|
|
|
|
|
| systemCL | systemDL | systemEL | systemFL | systemGL |
This is required image 1.
Please indicate either in your write-up or in your code which L-systems you use. If you happen to use command line arguments to specify filenames and don't tell us which systems you used, then we can't run your code to reproduce your image. So either hard-code which L-systems you use or indicate which ones you used to make the pictures in your report.
If you use a variation, include both the original and your variant in your writeup. (The difference does not have to be large.)
In the file growth.py, create a scene function that makes an image using your L-systems after 2, 3, and 4 iterations. Note, if using a different pattern of iterations is more interesting (e.g. 4, 5, 6 or 2, 4, 6) you are free to use a different set of three iteration values. Indicate what you used in your writeup.
This is required image 2.
Please indicate either in your write-up or in your code which L-systems you used (and include the txt files for your new L-systems with your code when you turn it in!).
base X rule X -> F-[[X]+X]+F[+FX]-X rule F -> FF
The __str__ method gets called automatically when an object is printed out. It's also called to implement casting an object to a string using str(thing). Note that your __str__ method should not print anything out. It should build a string from the information in your L-system and return the string. Remember that '\n' is how you create a newline character.
In the test main function the line:
print lsys
should print out your nicely formatted string instead of the generic class instance string when you run your lsystem.py file.
See if you can draw the base string and rule below the image of a tree from that L-system.
Make a new wiki page for your assignment. Put the label cs151s18project8
on the page. Each of you needs to make your own writeup.
In addition to making the wiki page writeup, put the python files you wrote on the Courses server in your private directory in a folder named project8.
In general, your writeup should follow the outline below.
© 2018 Caitrin Eaton.