|
2 | 2 | Your chance to explore Loops and Turtles! |
3 | 3 |
|
4 | 4 | Authors: David Mutchler, Dave Fisher, Valerie Galluzzi, Amanda Stouder, |
5 | | - their colleagues and PUT_YOUR_NAME_HERE. |
| 5 | + their colleagues and Benjamin Feaster. |
6 | 6 | """ |
7 | 7 | ######################################################################## |
8 | | -# TODO: 1. |
| 8 | +# DONE: 1. |
9 | 9 | # On Line 5 above, replace PUT_YOUR_NAME_HERE with your own name. |
10 | 10 | ######################################################################## |
11 | 11 |
|
12 | 12 | ######################################################################## |
13 | | -# TODO: 2. |
| 13 | +# DONE: 2. |
14 | 14 | # |
15 | 15 | # You should have RUN the PREVIOUS module and READ its code. |
16 | 16 | # (Do so now if you have not already done so.) |
|
28 | 28 | # |
29 | 29 | # Don't forget to COMMIT your work by using VCS ~ Commit and Push. |
30 | 30 | ######################################################################## |
| 31 | +import rosegraphics as rg |
| 32 | + |
| 33 | +window = rg.TurtleWindow() |
| 34 | + |
| 35 | +purple_turtle = rg.SimpleTurtle('turtle') |
| 36 | +purple_turtle.pen = rg.Pen('purple', 1) |
| 37 | +purple_turtle.speed = 100 |
| 38 | + |
| 39 | +red_turtle = rg.SimpleTurtle('turtle') |
| 40 | +red_turtle.pen = rg.Pen('red', 1) |
| 41 | +red_turtle.speed = 100 |
| 42 | + |
| 43 | +size = 150 |
| 44 | + |
| 45 | +for i in range(20): |
| 46 | + purple_turtle.draw_circle(size) |
| 47 | + red_turtle.draw_circle(size - 20) |
| 48 | + |
| 49 | + purple_turtle.right(100) |
| 50 | + purple_turtle.forward(10) |
| 51 | + purple_turtle.left(45) |
| 52 | + |
| 53 | + red_turtle.right(100) |
| 54 | + red_turtle.forward(10) |
| 55 | + red_turtle.left(45) |
| 56 | + |
| 57 | +window.close_on_mouse_click() |
0 commit comments