From ba623b25685f81dd3d961ccbd78c4d13f4e0938e Mon Sep 17 00:00:00 2001 From: chenh5 Date: Thu, 31 Aug 2017 10:26:53 -0400 Subject: [PATCH 1/6] add my name --- src/m3_turtles.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/m3_turtles.py b/src/m3_turtles.py index df507f3..8007df7 100644 --- a/src/m3_turtles.py +++ b/src/m3_turtles.py @@ -1,3 +1,4 @@ +# Hui Chen """ Demonstrates using OBJECTS via Turtle Graphics. From c68223a6aa4185ba6c4842c736cf00deef01824f Mon Sep 17 00:00:00 2001 From: chenh5 Date: Thu, 31 Aug 2017 12:46:37 -0400 Subject: [PATCH 2/6] m1, m2 --- src/m2_hello_world.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/m2_hello_world.py b/src/m2_hello_world.py index aaa506a..19d904e 100644 --- a/src/m2_hello_world.py +++ b/src/m2_hello_world.py @@ -59,10 +59,10 @@ # Look at the Console to be sure that your string printed as expected. # ######################################################################## - +print('Hello class') ######################################################################## # -# 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,7 +73,7 @@ # (HINT: It is an INTERESTING number.) Get help if your value is wrong. # ######################################################################## - +print (3607*34227) ######################################################################## # # TODO: 5. From 90e905e268683dc6d93ca8c6c4d0716bde4f43d2 Mon Sep 17 00:00:00 2001 From: chenh5 Date: Thu, 31 Aug 2017 12:57:54 -0400 Subject: [PATCH 3/6] M2 --- src/m2_hello_world.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/m2_hello_world.py b/src/m2_hello_world.py index 19d904e..15f72d4 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 +# # to # DONE. # Try it now on line 16 above, and note that its blue bar on @@ -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 @@ -76,7 +76,7 @@ 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 09fa2a4fcc9e6f6318d17522828d3252120d6f60 Mon Sep 17 00:00:00 2001 From: chenh5 Date: Thu, 31 Aug 2017 13:21:49 -0400 Subject: [PATCH 4/6] M3 --- src/m3_turtles.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/m3_turtles.py b/src/m3_turtles.py index 8007df7..c3d7d0f 100644 --- a/src/m3_turtles.py +++ b/src/m3_turtles.py @@ -11,11 +11,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 Hui Chen. """ ######################################################################## # -# 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. @@ -30,7 +30,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 @@ -64,6 +64,9 @@ dave.forward(100) dave.left(90) dave.forward(200) +# add 1 +dave.left(90) +dave.forward(100) # ---------------------------------------------------------------------- # Construct a new turtle and ask it to do things. @@ -78,7 +81,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. @@ -92,7 +95,7 @@ ######################################################################## # -# TODO: 4. +# DONE: 4. # The code above CONSTRUCTS two SimpleTurtle objects and gives those objects NAMES: # dave matt # @@ -110,7 +113,10 @@ # As always, test by running the module. # ######################################################################## - +hui = rg.SimpleTurtle() +hui.forward(200) +dave.right(90) +dave.forward(100) ######################################################################## # # TODO: 5. From 451874288b59d0924d6f2924162b41a3156d4efd Mon Sep 17 00:00:00 2001 From: chenh5 Date: Thu, 31 Aug 2017 13:22:25 -0400 Subject: [PATCH 5/6] 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 c3d7d0f..84fc57e 100644 --- a/src/m3_turtles.py +++ b/src/m3_turtles.py @@ -119,7 +119,7 @@ dave.forward(100) ######################################################################## # -# 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 205cba37a2dcdfa1d123332fd7e9134d7fb4d02b Mon Sep 17 00:00:00 2001 From: chenh5 Date: Thu, 31 Aug 2017 19:48:43 -0400 Subject: [PATCH 6/6] m5 --- src/m5_your_turtles.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/m5_your_turtles.py b/src/m5_your_turtles.py index d9de2a6..68680de 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 Hui Chen. """ ######################################################################## -# 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,25 @@ # # Don't forget to COMMIT your work by using VCS ~ Commit and Push. ######################################################################## +import rosegraphics as rg +window = rg.TurtleWindow() +green_turtle = rg.SimpleTurtle('turtle') +green_turtle.pen = rg.Pen('green', 5) +green_turtle.speed = 70 +radius=20 +for k in range(5): + green_turtle.draw_circle(radius) + green_turtle.pen_up() + green_turtle.forward(2*radius) + green_turtle.pen_down() + radius=radius*1.5 +red_turtle = rg.SimpleTurtle('turtle') +red_turtle.pen = rg.Pen('red', 6) +red_turtle.speed = 1 +size= 100 +for k in range(30): + red_turtle.draw_square(size) + red_turtle.right(45) + size= size+10 + red_turtle.speed= red_turtle.speed+10 +window.close_on_mouse_click()