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 include both the lsystem and interpreter modules. Unlike last week, however, your scene.py may not include 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 function. 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.)


Tasks

  1. We want to be able to change the color of elements in an Lsystem without affecting the color of other elements. We would also like to avoid setting colors, widths, or other turtle drawing features by adding new parameters to drawString. Modify your drawString function so that it supports five additional characters in the strings.

    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.

  2. The above simulations use a new character, L, in their drawings. Change your TurtleInterpreter to recognize this character and draw a leaf, which could be drawn as a semicircle or a circle or a line (you do not need to change the color). Go back and run classtest.py. This time your scene will contain a bunch of multi-colored fallen leaves!

  3. Create a file make_image2.py and write a function that makes a forest or garden of flowers that includes at least two different multi-rule L-systems with leaves or other ornaments that make use of the color store/restore.The following are variations with leaves and flowers, all defined by strings (no special characters except L). Try to include L-system trees with different numbers of iterations.
    systemCL systemDL systemEL systemFL systemGL

    This is required image 1.

  4. Make two new L-systems. They can be variations on one of the ones provided, an L-system from the ABOP book, or one you create on your own. The L-systems of interest are given in the ABOP book chapter 1, pages 10, 11, and 25.

    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 make_image3.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) you are free to use a different set of three iteration values. Indicate what you used in your writeup.

    This is required image 2.


Extensions

Each assignment will have a set of suggested extensions. The required tasks constitute about 85% of the assignment, and if you do only the required tasks and do them well you will earn a B+. To earn a higher grade, you need to undertake one or more extensions. The difficulty and quality of the extension or extensions will determine your final grade for the assignment. One complex extension, done well, or 2-3 simple extensions are typical.


Writeup and Hand-In

Before handing in your code, double check that it is well-styled:

Make a new wiki page for your assignment. Put the label cs151s14project8 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 Academics server in your private handin directory.

Colby Wiki

In general, your writeup should follow the outline below.