From 83215fbe928be37d73c96df6ef607eb9b25254ad Mon Sep 17 00:00:00 2001 From: levineha Date: Sun, 26 Nov 2017 04:05:44 -0500 Subject: [PATCH 1/4] 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..268b608 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 Hannah Levine. """ ######################################################################## # From 547855897434f69862c882e34b5fff7330c5ca74 Mon Sep 17 00:00:00 2001 From: levineha Date: Mon, 27 Nov 2017 14:24:14 -0500 Subject: [PATCH 2/4] I added my name. I went through each TODO, completed them, and changed the "TODO" to "DONE" for everything that was asked of me. --- src/m2_hello_world.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/m2_hello_world.py b/src/m2_hello_world.py index aaa506a..876fb9b 100644 --- a/src/m2_hello_world.py +++ b/src/m2_hello_world.py @@ -13,7 +13,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 +26,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 +51,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 @@ -59,10 +59,11 @@ # Look at the Console to be sure that your string printed as expected. # ######################################################################## +print('Computer Science') ######################################################################## # -# 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!). @@ -73,10 +74,11 @@ # (HINT: It is an INTERESTING number.) Get help if your value is wrong. # ######################################################################## +print(3607*34227) ######################################################################## # -# 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 895d4a3b805ec4e3bca740ffb781a095eff79ed0 Mon Sep 17 00:00:00 2001 From: levineha Date: Mon, 27 Nov 2017 14:37:37 -0500 Subject: [PATCH 3/4] I added my name. I went through each TODO, completed them, and changed the "TODO" to "DONE" for everything that was asked of me. --- src/m3_turtles.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/m3_turtles.py b/src/m3_turtles.py index 268b608..600f54d 100644 --- a/src/m3_turtles.py +++ b/src/m3_turtles.py @@ -14,10 +14,10 @@ """ ######################################################################## # -# 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. +# On Line 13 above, replace Hannah Levine with your OWN name. # # BTW, the top block of text above forms what is called a DOC-STRING. # It documents what this module does, in a way that exterior programs @@ -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 @@ -73,11 +73,13 @@ matt.backward(50) matt.left(90) matt.forward(50) +matt.right(40) +matt.backward(100) ######################################################################## # -# 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. @@ -91,7 +93,7 @@ ######################################################################## # -# TODO: 4. +# DONE: 4. # The code above CONSTRUCTS two SimpleTurtle objects and gives those objects NAMES: # dave matt # @@ -109,10 +111,19 @@ # As always, test by running the module. # ######################################################################## - +import rosegraphics as rg +window = rg.TurtleWindow() +window.delay(10) +cat = rg.SimpleTurtle('turtle') +cat.pen = rg.Pen('orange', 15) +cat.speed = 20 +cat.forward(200) +cat.left(50) +cat.backward(20) +cat.right(40) ######################################################################## # -# 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 6dfd8254bd2aaa78d77a680d5f4fdc2c314924f2 Mon Sep 17 00:00:00 2001 From: levineha Date: Mon, 27 Nov 2017 15:01:47 -0500 Subject: [PATCH 4/4] I added my name. I went through each TODO, completed them, and changed the "TODO" to "DONE" for everything that was asked of me. --- src/m5_your_turtles.py | 57 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/src/m5_your_turtles.py b/src/m5_your_turtles.py index d9de2a6..2d19fdb 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 Hannah Levine. """ ######################################################################## -# TODO: 1. -# On Line 5 above, replace PUT_YOUR_NAME_HERE with your own name. +# DONE: 1. +# On Line 5 above, replace Hannah Levine 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,52 @@ # # Don't forget to COMMIT your work by using VCS ~ Commit and Push. ######################################################################## +import rosegraphics as rg + +window = rg.TurtleWindow() + +spongebob = rg.SimpleTurtle('turtle') +spongebob.pen = rg.Pen('yellow', 5) +spongebob.speed = 50 # I made the speed 50. + +# The square will be 100 x 100 pixels: +size = 100 + +# My loop will do the indented code 6 times. Each time, it draws a square. +for k in range(6): + + # Put the pen down, then draw a square of the given size: + spongebob.draw_square(size) + + spongebob.pen_up() + spongebob.right(45) + spongebob.forward(10) + spongebob.left(45) + + # Now the code puts the pen down again. + spongebob.pen_down() + +import rosegraphics as rg + +window = rg.TurtleWindow() + +sandy = rg.SimpleTurtle('turtle') +sandy.pen = rg.Pen('green', 3) +sandy.speed = 30 # I made the speed 30. + +# The circle will be 200 x 200 pixels: +size = 200 + +radius=100 +# My loop will do the indented code 19 times. Each time, it draws a square. +for k in range(19): + + # Put the pen down, then draw a circle of the given size: + sandy.draw_circle(k) + radius= radius-1 + sandy.pen_up() + + # Now the code puts the pen down again. + sandy.pen_down() + +window.close_on_mouse_click()