From 9d92bd0f234a4645b3eaa95581df4c7cb402b114 Mon Sep 17 00:00:00 2001 From: fleethrd Date: Sun, 26 Nov 2017 15:28:02 -0500 Subject: [PATCH 1/8] I added my name --- src/m3_turtles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m3_turtles.py b/src/m3_turtles.py index df507f3..f35a6ab 100644 --- a/src/m3_turtles.py +++ b/src/m3_turtles.py @@ -10,7 +10,7 @@ -- ASSIGNING a VALUE to a NAME (VARIABLE). Authors: David Mutchler, Dave Fisher, Valerie Galluzzi, Amanda Stouder, - their colleagues and PUT_YOUR_NAME_HERE. + their colleagues and Ryan Feetham. """ ######################################################################## # From b074470f477ded5bff9962cce4ab3702d527a360 Mon Sep 17 00:00:00 2001 From: fleethrd Date: Mon, 27 Nov 2017 12:20:37 -0500 Subject: [PATCH 2/8] I did most of the TODOS --- src/m2_hello_world.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/m2_hello_world.py b/src/m2_hello_world.py index aaa506a..0ed38d7 100644 --- a/src/m2_hello_world.py +++ b/src/m2_hello_world.py @@ -1,4 +1,6 @@ print('Hello, World') +print('Joy to the World') +print(3607*34227) ######################################################################## # This line is a COMMENT -- a note to human readers of this file. @@ -13,7 +15,7 @@ ######################################################################## # -# TODO: 1. +# DONE: 1. # (Yes, that means for YOU to DO things per these instructions:) # # Run this module by right clicking anywhere in this window and select @@ -26,7 +28,7 @@ ######################################################################## # -# TODO: 2. +# DONE: 2. # Notice the small horizontal BLUE bars on the scrollbar-like thing # on the right. Each blue bar indicates a TO DO in this module. # @@ -51,7 +53,7 @@ ######################################################################## # -# TODO: 3. +# DONE: 3. # Add another print statement below. # It should print any string that you want (but keep it G-rated!) # Test your code by re-running this module using either the right click @@ -62,7 +64,7 @@ ######################################################################## # -# TODO: 4. +# DONE: 4. # Add yet another print statement. # This one should print the *product* of 3,607 and 34,227. # Let the computer do the arithmetic for you (no calculators!). From cb8039b36c6a176cc219511607be091274171b05 Mon Sep 17 00:00:00 2001 From: fleethrd Date: Mon, 27 Nov 2017 12:22:27 -0500 Subject: [PATCH 3/8] I completed all of the remaining TODOS --- src/m2_hello_world.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m2_hello_world.py b/src/m2_hello_world.py index 0ed38d7..d4965b8 100644 --- a/src/m2_hello_world.py +++ b/src/m2_hello_world.py @@ -36,7 +36,7 @@ # by clicking on the blue bars. ** Try that now. ** # # b. When you have completed a TO DO, you should change the word -# TODO +# DONE # to # DONE. # Try it now on line 16 above, and note that its blue bar on @@ -78,7 +78,7 @@ ######################################################################## # -# TODO: 5. +# DONE: 5. # Look at the list of files in this project to the left. # Note that this file (m2_hello_world.py) is now displayed in a blue # font color (if the file is highlighted select a different file so yu can From e37848b25dcb95183970a7d0c6d2ebd47277e672 Mon Sep 17 00:00:00 2001 From: fleethrd Date: Mon, 27 Nov 2017 12:40:09 -0500 Subject: [PATCH 4/8] I completed all of the TODOS --- src/m3_turtles.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/m3_turtles.py b/src/m3_turtles.py index f35a6ab..db64b13 100644 --- a/src/m3_turtles.py +++ b/src/m3_turtles.py @@ -14,7 +14,7 @@ """ ######################################################################## # -# TODO: 1. +# DONE: 1. # (Yes, that means for YOU to DO things per these instructions:) # # On Line 13 above, replace PUT_YOUR_OWN_NAME_HERE with your OWN name. @@ -29,7 +29,7 @@ ######################################################################## # -# TODO: 2. +# DONE: 2. # Allow this file to use the rosegraphics.py file by marking the src # directory as a "Sources Root". Do that by right clicking on the src folder, # then selector Mark Directory As --> Sources Root @@ -77,7 +77,7 @@ ######################################################################## # -# TODO: 3. +# DONE: 3. # Add a few more line of your own code above to make one of the # existing Turtles move some more and/or have different # characteristics. @@ -88,10 +88,17 @@ # As always, test by running the module. # ######################################################################## +dave.pen = rg.Pen('green',10) +dave.left(90) +dave.forward(200) +matt.pen = rg.Pen('blue',20) +matt.right(90) +matt.forward(300) + ######################################################################## # -# TODO: 4. +# DONE: 4. # The code above CONSTRUCTS two SimpleTurtle objects and gives those objects NAMES: # dave matt # @@ -109,10 +116,17 @@ # As always, test by running the module. # ######################################################################## +Ryan = rg.SimpleTurtle() +Ryan.forward(250) +Ryan.left(135) +Ryan.pen = rg.Pen('purple',30) +Ryan.forward(400) +Ryan.right(270) +Ryan.forward(200) ######################################################################## # -# TODO: 5. +# DONE: 5. # Run one more time to be sure that all is still OK. # Ensure that no blue bars on the scrollbar-thing to the right remain. # From bb4a818e4367ff40e3464fb2ba720f850ae788dc Mon Sep 17 00:00:00 2001 From: fleethrd Date: Mon, 27 Nov 2017 16:04:32 -0500 Subject: [PATCH 5/8] done --- src/m2_hello_world.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/m2_hello_world.py b/src/m2_hello_world.py index d4965b8..a5a6ed0 100644 --- a/src/m2_hello_world.py +++ b/src/m2_hello_world.py @@ -1,6 +1,4 @@ print('Hello, World') -print('Joy to the World') -print(3607*34227) ######################################################################## # This line is a COMMENT -- a note to human readers of this file. @@ -61,6 +59,8 @@ # Look at the Console to be sure that your string printed as expected. # ######################################################################## +print('Joy to the World') + ######################################################################## # @@ -75,6 +75,8 @@ # (HINT: It is an INTERESTING number.) Get help if your value is wrong. # ######################################################################## +print(3607 * 34227) + ######################################################################## # From f5e30041d783c54c85ce6d90dc05982995cdf8eb Mon Sep 17 00:00:00 2001 From: fleethrd Date: Mon, 27 Nov 2017 16:10:39 -0500 Subject: [PATCH 6/8] done --- src/m3_turtles.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/m3_turtles.py b/src/m3_turtles.py index db64b13..022ced3 100644 --- a/src/m3_turtles.py +++ b/src/m3_turtles.py @@ -74,6 +74,12 @@ matt.left(90) matt.forward(50) +dave.pen = rg.Pen('green', 10) +dave.left(90) +dave.forward(200) +matt.pen = rg.Pen('blue', 20) +matt.right(90) +matt.forward(300) ######################################################################## # @@ -88,12 +94,6 @@ # As always, test by running the module. # ######################################################################## -dave.pen = rg.Pen('green',10) -dave.left(90) -dave.forward(200) -matt.pen = rg.Pen('blue',20) -matt.right(90) -matt.forward(300) ######################################################################## From 9990d6b0e0ba1f838b2b1775add180821ca8228b Mon Sep 17 00:00:00 2001 From: fleethrd Date: Mon, 27 Nov 2017 17:09:35 -0500 Subject: [PATCH 7/8] done --- src/m5_your_turtles.py | 137 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 134 insertions(+), 3 deletions(-) diff --git a/src/m5_your_turtles.py b/src/m5_your_turtles.py index d9de2a6..f2062c0 100644 --- a/src/m5_your_turtles.py +++ b/src/m5_your_turtles.py @@ -2,15 +2,15 @@ Your chance to explore Loops and Turtles! Authors: David Mutchler, Dave Fisher, Valerie Galluzzi, Amanda Stouder, - their colleagues and PUT_YOUR_NAME_HERE. + their colleagues and Ryan Fleetham. """ ######################################################################## -# TODO: 1. +# DONE: 1. # On Line 5 above, replace PUT_YOUR_NAME_HERE with your own name. ######################################################################## ######################################################################## -# TODO: 2. +# DONE: 2. # # You should have RUN the PREVIOUS module and READ its code. # (Do so now if you have not already done so.) @@ -28,3 +28,134 @@ # # Don't forget to COMMIT your work by using VCS ~ Commit and Push. ######################################################################## +import rosegraphics as rg + +# define variables +speed = 10 +size = 100 +thickness = 3 + +window = rg.TurtleWindow() + +# set up all of the turtles +blue_turtle = rg.SimpleTurtle('turtle') +blue_turtle.pen = rg.Pen('blue', thickness) +blue_turtle.speed = speed + +red_turtle = rg.SimpleTurtle('turtle') +red_turtle.pen = rg.Pen('red', thickness) +red_turtle.speed = speed + +green_turtle = rg.SimpleTurtle('turtle') +green_turtle.pen = rg.Pen('green', thickness) +green_turtle.speed = speed + +purple_turtle = rg.SimpleTurtle('turtle') +purple_turtle.pen = rg.Pen('purple', thickness) +purple_turtle.speed = speed + +orange_turtle = rg.SimpleTurtle('turtle') +orange_turtle.pen = rg.Pen('orange', thickness) +orange_turtle.speed = speed + +pink_turtle = rg.SimpleTurtle('turtle') +pink_turtle.pen = rg.Pen('pink', thickness) +pink_turtle.speed = speed + +brown_turtle = rg.SimpleTurtle('turtle') +brown_turtle.pen = rg.Pen('brown', thickness) +brown_turtle.speed = speed + +black_turtle = rg.SimpleTurtle('turtle') +black_turtle.pen = rg.Pen('black', thickness) +black_turtle.speed = speed + +for k in range(4): + # Put the pen down, then draw a square of the given size: + blue_turtle.draw_square(size) + + # Pick up the pen and turn right + blue_turtle.pen_up() + blue_turtle.right(90) + + # Put the pen down again (so drawing resumes). + blue_turtle.pen_down() + +for k in range(3): + # Put the pen down, then draw a triangle of the given size: + red_turtle.draw_regular_polygon(3, size) + + # Pick up the pen and turn right. + red_turtle.pen_up() + red_turtle.left(120) + + # Put the pen down again (so drawing resumes). + red_turtle.pen_down() + +for k in range(5): + # Put the pen down, then draw a pentagon of the given size: + green_turtle.draw_regular_polygon(5, size) + + # Pick up the pen and turn right + green_turtle.pen_up() + green_turtle.left(72) + + # Put the pen down again (so drawing resumes). + green_turtle.pen_down() + +for k in range(6): + # Put the pen down, then draw a hexagon of the given size: + purple_turtle.draw_regular_polygon(6, size) + + # Pick up the pen and turn right + purple_turtle.pen_up() + purple_turtle.left(60) + + # Put the pen down again (so drawing resumes). + purple_turtle.pen_down() + +for k in range(7): + # Put the pen down, then draw a heptagon of the given size: + orange_turtle.draw_regular_polygon(7, size) + + # Pick up the pen and turn right + orange_turtle.pen_up() + orange_turtle.left(51.4285714) + + # Put the pen down again (so drawing resumes). + orange_turtle.pen_down() + +for k in range(8): + # Put the pen down, then draw a octagon of the given size: + pink_turtle.draw_regular_polygon(8, size) + + # Pick up the pen and turn right + pink_turtle.pen_up() + pink_turtle.left(45) + + # Put the pen down again (so drawing resumes). + pink_turtle.pen_down() + +for k in range(9): + # Put the pen down, then draw a nonagon of the given size: + brown_turtle.draw_regular_polygon(9, size) + + # Pick up the pen and turn right + brown_turtle.pen_up() + brown_turtle.left(40) + + # Put the pen down again (so drawing resumes). + brown_turtle.pen_down() + +for k in range(10): + # Put the pen down, then draw a decagon of the given size: + black_turtle.draw_regular_polygon(10, size) + + # Pick up the pen and turn right + black_turtle.pen_up() + black_turtle.left(36) + + # Put the pen down again (so drawing resumes). + black_turtle.pen_down() + +window.close_on_mouse_click() From a4bf3f6e958dc88141655576df91fc7bf433817a Mon Sep 17 00:00:00 2001 From: fleethrd Date: Mon, 27 Nov 2017 17:11:21 -0500 Subject: [PATCH 8/8] done --- src/m5_your_turtles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m5_your_turtles.py b/src/m5_your_turtles.py index f2062c0..57dc23c 100644 --- a/src/m5_your_turtles.py +++ b/src/m5_your_turtles.py @@ -30,7 +30,7 @@ ######################################################################## import rosegraphics as rg -# define variables +# define constants speed = 10 size = 100 thickness = 3