@@ -12,24 +12,24 @@ public static void main(String[] args)
1212 {
1313 // Show the tortoise --#1
1414 Tortoise .show ();
15- // Make the tortoise move as fast as possible --#7
15+ // Make the tortoise move as fast as possible --#6
1616 Tortoise .setSpeed (10 );
17- // Make the background silver (use PenColors) --#8
17+ // Make the background silver (use PenColors) --#7
1818 Tortoise .getBackgroundWindow ().setBackground (PenColors .Grays .Silver );
19- // Make the line the tortoise draws 3 pixels wide --#15
19+ // Make the line the tortoise draws 3 pixels wide --#12
2020 Tortoise .setPenWidth (3 );
21- // CreateColorPalette (recipe below) --#9
21+ // CreateColorPalette (recipe below) --#8.1
2222 createColorPalette ();
23- // Do the following 15 times --#13
23+ // Do the following 15 times --#11.1
2424 for (int i = 0 ; i < 15 ; i ++)
2525 {
26- // DrawOctogon (recipe below) --#10
26+ // DrawOctogon (recipe below) --#9.1
2727 drawOctogon ();
28- // Turn the tortoise 1/15th of 360 degrees to the right --#12
28+ // Turn the tortoise 1/15th of 360 degrees to the right --#10
2929 Tortoise .turn (360.0 / 15 );
3030 }
3131 }
32- // ------------- Recipe for CreateColorPalette --#9
32+ // ------------- Recipe for CreateColorPalette --#8.2
3333 private static void createColorPalette ()
3434 {
3535 Color color1 = PenColors .Reds .Red ;
@@ -44,20 +44,22 @@ private static void createColorPalette()
4444 ColorWheel .addColor (color3 );
4545 ColorWheel .addColor (color2 );
4646 ColorWheel .addColor (color1 );
47- //
47+ // ------------- End of createColorPalette recipe --#8.3
4848 }
49- // ------------- Recipe for DrawOctogon --#10
49+ // ------------- Recipe for DrawOctogon --#9.2
5050 private static void drawOctogon ()
5151 {
52- // Do the following 8 times --#6
52+ // Do the following 8 times --#5.1
5353 for (int i = 0 ; i < 8 ; i ++)
5454 {
55- // Change the pen color of the line the tortoise draws to the next color on the color wheel --#4
55+ // Change the pen color of the line the tortoise draws to the next color on the color wheel --#3
5656 Tortoise .setPenColor (ColorWheel .getNextColor ());
5757 // Move the tortoise 50 pixels --#2
5858 Tortoise .move (50 );
59- // Turn the tortoise 1/8th of 360 degrees to the right --#5
59+ // Turn the tortoise 1/8th of 360 degrees to the right --#4
6060 Tortoise .turn (360.0 / 8 );
61+ // End Repeat --#5.2
6162 }
63+ // ------------- End of drawOctogon recipe --#10.3
6264 }
6365}
0 commit comments