From ee352bae02c95d969981fcf91a0337ec57fc71dd Mon Sep 17 00:00:00 2001 From: arcots Date: Sun, 26 Nov 2017 21:42:27 -0500 Subject: [PATCH 1/5] Completed m1 and m2 --- src/m1e_comments_strings_print.py | 1 + src/m2_hello_world.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/m1e_comments_strings_print.py b/src/m1e_comments_strings_print.py index 18eb8a0..eb0db7b 100644 --- a/src/m1e_comments_strings_print.py +++ b/src/m1e_comments_strings_print.py @@ -14,3 +14,4 @@ print('one', 'two', 'buckle my shoe') print(3 + 9) print('3 + 9', 'versus', 3 + 9) + diff --git a/src/m2_hello_world.py b/src/m2_hello_world.py index aaa506a..6ebe974 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. # @@ -34,7 +34,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 @@ -51,18 +51,19 @@ ######################################################################## # -# 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 # method again or by using the play button in the upper right. # Look at the Console to be sure that your string printed as expected. # +print('Satya') ######################################################################## ######################################################################## # -# 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!). @@ -72,6 +73,8 @@ # whom you trust: What number did your print display for TO DO 4? # (HINT: It is an INTERESTING number.) Get help if your value is wrong. # +a = (3607 * 34227) +print(a) ######################################################################## ######################################################################## From cd9fd7f5ac666c491205efe5e45d54cbfc9a4958 Mon Sep 17 00:00:00 2001 From: arcots Date: Sun, 26 Nov 2017 21:42:35 -0500 Subject: [PATCH 2/5] Completed m1 and m2 --- src/m2_hello_world.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m2_hello_world.py b/src/m2_hello_world.py index 6ebe974..89f9a21 100644 --- a/src/m2_hello_world.py +++ b/src/m2_hello_world.py @@ -79,7 +79,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 0599d27e57ee97ddd46ee082bce7628531c6e95d Mon Sep 17 00:00:00 2001 From: arcots Date: Mon, 27 Nov 2017 10:33:42 -0500 Subject: [PATCH 3/5] Completed m3 --- src/m3_turtles.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/m3_turtles.py b/src/m3_turtles.py index df507f3..5165b09 100644 --- a/src/m3_turtles.py +++ b/src/m3_turtles.py @@ -10,11 +10,11 @@ -- 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 Satya Arcot. """ ######################################################################## # -# TODO: 1. +# DONEs: 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 @@ -73,11 +73,14 @@ matt.backward(50) matt.left(90) matt.forward(50) +matt.pen = rg.Pen('green', 25) +matt.right(90) +matt.forward(80) ######################################################################## # -# 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 +94,7 @@ ######################################################################## # -# TODO: 4. +# DONE: 4. # The code above CONSTRUCTS two SimpleTurtle objects and gives those objects NAMES: # dave matt # @@ -109,10 +112,19 @@ # As always, test by running the module. # ######################################################################## +satya = rg.SimpleTurtle('turtle') +satya.pen = rg.Pen('orange', 10) +satya.forward(70) +satya.right(90) +satya.forward(70) +satya.right(90) +satya.forward(70) +satya.right(90) +satya.forward(70) ######################################################################## # -# 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 81af5c284d53e0e27f2c0f1e7c9ab6b9f359cc91 Mon Sep 17 00:00:00 2001 From: arcots Date: Mon, 27 Nov 2017 10:38:55 -0500 Subject: [PATCH 4/5] Completed m3 --- 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 5165b09..f8aa0ac 100644 --- a/src/m3_turtles.py +++ b/src/m3_turtles.py @@ -14,7 +14,7 @@ """ ######################################################################## # -# DONEs: 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. From 36bac079efc3ec39ff2b3f6b1e3ebb24bb4dc457 Mon Sep 17 00:00:00 2001 From: arcots Date: Mon, 27 Nov 2017 10:57:51 -0500 Subject: [PATCH 5/5] Completed m5 --- src/m5_your_turtles.py | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/src/m5_your_turtles.py b/src/m5_your_turtles.py index d9de2a6..eb88d7b 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 Satya Arcot. """ ######################################################################## -# TODO: 1. +# DONEs: 1. # On Line 5 above, replace PUT_YOUR_NAME_HERE with your own name. ######################################################################## - +import rosegraphics as rg ######################################################################## -# 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,32 @@ # # Don't forget to COMMIT your work by using VCS ~ Commit and Push. ######################################################################## +window = rg.TurtleWindow() + +green_turtle = rg.SimpleTurtle('turtle') +green_turtle.pen = rg.Pen('green', 15) +green_turtle.speed = 12 +radius = 150 +for k in range(30): + green_turtle.draw_circle(radius) + + green_turtle.pen_up() + green_turtle.right(90) + green_turtle.forward(7) + green_turtle.pen_down() + + radius = radius - 10 + +red_turtle = rg.SimpleTurtle('turtle') +red_turtle.pen = rg.Pen('red', 7) +red_turtle.speed = 12 +size = 200 +for k in range(15): + red_turtle.draw_square(size) + + red_turtle.pen_up() + red_turtle.left(90) + red_turtle.forward(10) + red_turtle.pen_down() + + size = size - 20