From 136f67ec128519feab1d05461e0b212b0edab095 Mon Sep 17 00:00:00 2001 From: Justin Diaz Date: Thu, 20 Jun 2013 20:12:09 -0700 Subject: [PATCH 1/4] pentagon crazy progress- Justin --- .../src/org/teachingkidsprogramming/recipes/PentagonCrazy.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java b/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java index 21e59a11..5b5da618 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java +++ b/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java @@ -1,5 +1,7 @@ package org.teachingkidsprogramming.recipes; +import org.teachingextensions.logo.Tortoise; + public class PentagonCrazy { public static void main(String[] args) @@ -25,6 +27,7 @@ public static void main(String[] args) // ------------- End of adjustPen recipe // Move the tortoise the length of a side --#4 // Turn the tortoise 1/5th of 360 degrees --#1 + Tortoise.turn(360 / 5); // Turn the tortoise 1 more degree --#5 // Repeat // ------------- End of drawPentagon recipe From 2c5fbe1aaede537abb9136be2e48dd63323782a7 Mon Sep 17 00:00:00 2001 From: Justin Diaz Date: Thu, 20 Jun 2013 21:01:36 -0700 Subject: [PATCH 2/4] pentagon crazy prog2 - justin --- .../recipes/PentagonCrazy.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java b/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java index 5b5da618..86667b9d 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java +++ b/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java @@ -1,35 +1,41 @@ package org.teachingkidsprogramming.recipes; +import org.teachingextensions.logo.ColorWheel; +import org.teachingextensions.logo.Colors.Blues; +import org.teachingextensions.logo.Colors.Purples; import org.teachingextensions.logo.Tortoise; public class PentagonCrazy { public static void main(String[] args) { - // Make the tortoise move as fast as possible --#3 - // createColorPalette (recipe below) --#8 + Tortoise.setSpeed(10); // ------------- Recipe for createColorPalette --#8 - // Add steel blue to the color wheel --#7 - // Add dark orchid to the color wheel --#11 - // Add dark slate blue to the color wheel --#12 - // Add teal to the color wheel --#13 - // Add indigo to the color wheel --#14 + createColorPalette(); // ------------- End of createColorPalette recipe // DrawPentagon (recipe below) --#10 // ------------- Recipe for drawPentagon --#10 // Do the following 200 times --#2 // AdjustPen (recipe below) --#9 // ------------- Recipe for adjustPen --#9 - // Change the color of the line the tortoise draws to the next color on the color wheel --#6 - // Increase the tortoises pen width by 1 --#15 + Tortoise.setPenColor(ColorWheel.getNextColor()); + // Increase the tortoises pen width by 1 --#15 + Tortoise.setPenWidth(+1); // If the tortoises pen width is greater than 4, then --#17 // Reset it to 1 --#16 // ------------- End of adjustPen recipe // Move the tortoise the length of a side --#4 - // Turn the tortoise 1/5th of 360 degrees --#1 Tortoise.turn(360 / 5); // Turn the tortoise 1 more degree --#5 // Repeat // ------------- End of drawPentagon recipe } + private static void createColorPalette() + { + ColorWheel.addColor(Blues.SteelBlue); + ColorWheel.addColor(Purples.DarkOrchid); + ColorWheel.addColor(Blues.DarkSlateBlue); + ColorWheel.addColor(Blues.Teal); + ColorWheel.addColor(Purples.Indigo); + } } From eece171f0df739ccb2d3af276f0f4da87d8103e7 Mon Sep 17 00:00:00 2001 From: Justin Diaz Date: Thu, 20 Jun 2013 21:02:50 -0700 Subject: [PATCH 3/4] pentagon crazy prog2- justin --- .../src/org/teachingkidsprogramming/recipes/PentagonCrazy.java | 1 - 1 file changed, 1 deletion(-) diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java b/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java index 86667b9d..da3881f5 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java +++ b/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java @@ -20,7 +20,6 @@ public static void main(String[] args) // ------------- Recipe for adjustPen --#9 Tortoise.setPenColor(ColorWheel.getNextColor()); // Increase the tortoises pen width by 1 --#15 - Tortoise.setPenWidth(+1); // If the tortoises pen width is greater than 4, then --#17 // Reset it to 1 --#16 // ------------- End of adjustPen recipe From a0ca87c01a299288d57835064b96605b41fac724 Mon Sep 17 00:00:00 2001 From: Justin Diaz Date: Sun, 23 Jun 2013 15:55:22 -0700 Subject: [PATCH 4/4] pentagon crazy finished - Justin --- .../recipes/PentagonCrazy.java | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java b/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java index da3881f5..d9647f21 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java +++ b/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/PentagonCrazy.java @@ -10,24 +10,28 @@ public class PentagonCrazy public static void main(String[] args) { Tortoise.setSpeed(10); - // ------------- Recipe for createColorPalette --#8 createColorPalette(); - // ------------- End of createColorPalette recipe - // DrawPentagon (recipe below) --#10 - // ------------- Recipe for drawPentagon --#10 - // Do the following 200 times --#2 - // AdjustPen (recipe below) --#9 - // ------------- Recipe for adjustPen --#9 + drawPentagon(); + } + private static void drawPentagon() + { + for (int i = 1; i <= 200; i++) + { + adjustPen(); + Tortoise.move(i); + Tortoise.turn(360 / 5); + Tortoise.turn(1); + } + } + private static void adjustPen() + { Tortoise.setPenColor(ColorWheel.getNextColor()); - // Increase the tortoises pen width by 1 --#15 - // If the tortoises pen width is greater than 4, then --#17 - // Reset it to 1 --#16 - // ------------- End of adjustPen recipe - // Move the tortoise the length of a side --#4 - Tortoise.turn(360 / 5); - // Turn the tortoise 1 more degree --#5 - // Repeat - // ------------- End of drawPentagon recipe + Tortoise.setPenWidth(Tortoise.getPenWidth() + 1); + if (Tortoise.getPenWidth() > 4) + ; + { + Tortoise.setPenWidth(1); + } } private static void createColorPalette() {