Skip to content

Commit 39e1450

Browse files
committed
Update Digiflower
line numbers
1 parent 2446a0e commit 39e1450

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

src/main/java/org/teachingkidsprogramming/recipes/completed/section04mastery/DigiFlower.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/main/java/org/teachingkidsprogramming/section04mastery/DigiFlower.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ public class DigiFlower
1010
public static void main(String[] args)
1111
{
1212
// Show the tortoise --#1
13-
// Make the tortoise move as fast as possible --#7
14-
// Make the background silver --#8
15-
// Make the line the tortoise draws 3 pixels wide --#15
16-
// createColorPalette (recipe below) --#9.1
17-
// Do the following 15 times --#13.1
18-
// drawOctogon (recipe below) --#10.1
19-
// Turn the tortoise 1/15th of 360 degrees to the right --#12
20-
// End Repeat --#14.2
21-
// ------------- Recipe for createColorPalette --#9.2
13+
// Make the tortoise move as fast as possible --#6
14+
// Make the background silver --#7
15+
// Make the line the tortoise draws 3 pixels wide --#12
16+
// createColorPalette (recipe below) --#8.1
17+
// Do the following 15 times --#11.1
18+
// drawOctogon (recipe below) --#9.1
19+
// Turn the tortoise 1/15th of 360 degrees to the right --#10
20+
// End Repeat --#11.2
21+
// ------------- Recipe for createColorPalette --#8.2
2222
Color color1 = PenColors.Reds.Red;
2323
Color color2 = PenColors.Oranges.DarkOrange;
2424
Color color3 = PenColors.Yellows.Gold;
@@ -31,14 +31,14 @@ public static void main(String[] args)
3131
ColorWheel.addColor(color3);
3232
ColorWheel.addColor(color2);
3333
ColorWheel.addColor(color1);
34-
// ------------- End of createColorPalette recipe --#9.3
34+
// ------------- End of createColorPalette recipe --#8.3
3535
//
36-
// ------------- Recipe for drawOctogon --#10.2
37-
// Do the following 8 times --#6.1
38-
// Change the pen color of the line the tortoise draws to the next color on the color wheel --#4
36+
// ------------- Recipe for drawOctogon --#9.2
37+
// Do the following 8 times --#5.1
38+
// Change the pen color of the line the tortoise draws to the next color on the color wheel --#3
3939
// Move the tortoise 50 pixels --#2
40-
// Turn the tortoise 1/8th of 360 degrees to the right --#5
41-
// End Repeat --#6.2
40+
// Turn the tortoise 1/8th of 360 degrees to the right --#4
41+
// End Repeat --#5.2
4242
// ------------- End of drawOctogon recipe --#10.3
4343
}
4444
}

0 commit comments

Comments
 (0)