Using functions it is possible to create more complex drawings without a lot more code. If a function is written to be flexible or abstract it can be used to draw multiple different elements.
Details
Create a Python program that uses the turtle module to draw a picture. The picture can be anything you want, but must:
- not be derivative of previous work.
- have a function that draws something. The function must:
- have multiple parameters that change what is drawn.
- be called repeatedly as a component of a more complex drawing.
Extra
Superb drawings will receive extra credit. I will be the arbiter of whether a drawing is astounding.
Grading
The assignment will be graded on the following requirements according to the course’s programming assignment rubric.
Effort (40%): Here are example drawings with average effort:
Functionality (35%): A functional program will:
- not be derivative of previous work.
- have a function that draws something.
- the function must have multiple parameters that change what is drawn.
- the function must be called repeatedly as a component of a more complex drawing.
Style (25%): A program with good style will:
- include a header comment signifying the authors of the file.
- avoid magic numbers (literal primitive numbers).
- use meaningful names for variables and functions.
- have statements that are small (80 characters or less including leading space) and do one thing.
- have functions that are small (40 lines or less including comments) and do one thing.
- have a comment above functions that includes the purpose, the pre-conditions, and the post-conditions of the function.
- have spaces after commas in argument lists and spaces on both sides of binary operators (=, +, -, *, etc.).
Submission
Submit your program as a .py file on the course Inquire page before class on Wednesday October 7th.