|
1 | 1 | package org.teachingkidsprogramming.section04mastery; |
2 | 2 |
|
3 | 3 | import org.teachingextensions.logo.Tortoise; |
| 4 | +import org.teachingextensions.logo.utils.ColorUtils.ColorWheel; |
| 5 | +import org.teachingextensions.logo.utils.ColorUtils.PenColors; |
4 | 6 |
|
5 | 7 | public class KnottedRing |
6 | 8 | { |
7 | 9 | public static void main(String[] args) |
8 | 10 | { |
9 | 11 | Tortoise.show(); |
10 | 12 | // Make the tortoise move as fast as possible --#4 |
11 | | - // createColorPalette (recipe below) --#7.1 |
12 | | - // |
13 | | - // ------------- Recipe for createColorPalette --#7.2 |
14 | | - // Add hot pink to the color wheel --#6 |
15 | | - // Add red to the color wheel --#13 |
16 | | - // Add fuchsia to the color wheel --#14 |
17 | | - // Add orange red to the color wheel --#15 |
18 | | - // Add deep pink to the color wheel --#16 |
19 | | - // Add medium violet red to the color wheel --#17 |
20 | | - // Add crimson to the color wheel --#18 |
21 | | - // Add tomato to the color wheel --#19 |
22 | | - // ------------- End of createColorPalette recipe --#7.3 |
23 | | - // Do the following 30 times --#11.1 |
| 13 | + createColorPalette(); |
| 14 | + // Do the following 30 times --#10.1 |
24 | 15 | // Change the pen color of the line the tortoise draws to the next color from the color wheel --#5 |
25 | | - // drawOctagonWithOverlap (recipe below) --#9 |
26 | | - // ------------- Recipe for drawOctagonWithOverlap --#8.1 |
| 16 | + // drawOctagonWithOverlap (recipe below) --#8.0 |
| 17 | + // ------------- Recipe for drawOctagonWithOverlap --#7.1 |
27 | 18 | // Do the following 8 + 1 times --#3.1 |
28 | 19 | // Move the tortoise 110 pixels --#1 |
29 | 20 | // Turn the tortoise 1/8th of 360 degrees to the right --#2 |
30 | 21 | // Repeat --#3.2 |
31 | | - // ------------- End of drawOctagonWithOverlap recipe --#8.2 |
32 | | - // Turn the tortoise 1/30th of 360 degrees to the right --#10 |
33 | | - // Turn the tortoise 5 more degrees to the right --#12 |
34 | | - // Repeat --#11.2 |
| 22 | + // ------------- End of drawOctagonWithOverlap recipe --#7.2 |
| 23 | + // Turn the tortoise 1/30th of 360 degrees to the right --#9 |
| 24 | + // Turn the tortoise 5 more degrees to the right --#11 |
| 25 | + // Repeat --#10.2 |
| 26 | + } |
| 27 | + private static void createColorPalette() |
| 28 | + { |
| 29 | + ColorWheel.addColor(PenColors.Pinks.HotPink); |
| 30 | + ColorWheel.addColor(PenColors.Reds.Red); |
| 31 | + ColorWheel.addColor(PenColors.Pinks.Fuchsia); |
| 32 | + ColorWheel.addColor(PenColors.Reds.OrangeRed); |
| 33 | + ColorWheel.addColor(PenColors.Pinks.DeepPink); |
| 34 | + ColorWheel.addColor(PenColors.Reds.MediumVioletRed); |
| 35 | + ColorWheel.addColor(PenColors.Reds.Crimson); |
| 36 | + ColorWheel.addColor(PenColors.Reds.Tomato); |
35 | 37 | } |
36 | 38 | } |
0 commit comments