CS414 Spring 2017 Program #4

Due: Monday, March 27th, 2017.
Late penalties: Tue: -5%, Wed -10%

Before You Begin:

When You Are Done:

To turn your work in, go to mycourses.unh.edu, find CS414, and find the assignment. Then click "Submit Assignment" to upload the three files you will have created: initials.py, octagons.py, and crosses.py.

Questions:

  1. Create a program initials.py which draws your initials on the turtle window.

  2. Create a program octagons.py which covers the turtle window with octagons and squares, as in this picture:

    Method: create a function:
                def draw_tile(x, y):
                   ...
                   ...
              
    which draws a green octagon with one attached yellow diamond. In your main program, use a double for loop that calls draw_tile() repeatedly.

    Try it with graph paper first!



  3. Create a prorgam crosses.py which covers the turtle screen with latin crosses, as in this picture:

    Method: again, create a function:

                def draw_cross(x, y):
                   ...
                   ...
              
    which draws a latin cross. In your main program, use a double for loop that calls draw_tile() repeatedly. Notice that each cross is not exactly to the right of its neighbor: it's to the right, and down a bit.

    Again, do it with graph paper first!

Where to get graph paper: Here is some for a 400×400 turtle window grid.pdf. You can also google "graph paper" to get more samples.