Project 5: Turtle Graphics 2
Problem Statement
We all seen pictures where inside one picture is a smaller version of another picture or the same picture to infinity. Algorithmically, the best way to think about that problem is in terms of size, position and orientation. The normal-size scene has a particular size, starting position and orientation (horizontal, let’s say). The smaller version is the same thing, but with a different size, starting position and possibly orientation. This leads us to think about size, position and orientation as parameters of drawing a scene, where the parameters can change. The trick is to think about how you want to make a turtle draw something at the expected position, size and orientation.
For this project, you will draw a smaller scene inside your original scene.
Your program will:
- accept one command line argument that alters some aspect of the drawing. If no argument is supplied at the command line, your program should assign the parameter a default value.
- build more complex, compound shapes as compared to your first turtle project.
- define shape functions that accept a scaling factor as an argument, so they can draw shapes of different sizes easily.
- embed a smaller scene within a larger scene.
Directions
-
Develop your algorithm in detail before writing any code. Read the problem statement closely several times to make sure you understand all the small details and requirements.
-
Open your assignment repository from Project 2: Turtle Graphics. Copy your source code from that project, and paste it into this project’s src/exercise.py file. You will modify and add to that code for this project.
- Accept the assignment in GitHub by opening the Assignment Invitation URL link provided in your Canvas assignment.
- This video provides step-by-step directions for completing GitHub assignments.
-
From inside your GitHub repository, click the Work in Repl.it button.
-
Open the
exercise.py
file in thesrc
directory, and begin coding your solution. -
Execute your finished program, and capture a screenshot of your finished scene.
-
Update the module docstring with your information.
-
Click the Version Control icon in the left menu, type a memo in the What did you change text box, then click Commit & push
- Upload the screenshot of your finished turtle scene to the screenshot directory.
Helpful Resources
- Questions & Answers
- Turtle Graphics: Scene from a forest
- Python Turtle Graphics Documentation
- MindTap Textbook, Sections 5.2 and 7.1