Skip to content

Commit 92b71a3

Browse files
committed
Updated English comment for ManyAnimals w/Samantha
1 parent 95f0c84 commit 92b71a3

2 files changed

Lines changed: 40 additions & 36 deletions

File tree

src/org/teachingkidsprogramming/recipes/completed/ManyAnimals.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,50 @@ public ManyAnimals()
1111
{
1212
showSomeTurtles();
1313
}
14-
//create container for Turtles HINT: Use ArrayList
14+
//Create a container to hold your turtles HINT: Use ArrayList --#2.1
1515
public ArrayList<Turtle> turtles = new ArrayList<Turtle>();
16-
//create a window for many turtles HINT: Use MultiTurtlePanel
16+
//Create a window to show your turtles HINT: Use MultiTurtlePanel --#1.1
1717
public MultiTurtlePanel mt = new MultiTurtlePanel();
1818
private void showSomeTurtles()
1919
{
20-
//show the panel
20+
//Show your panel --#1.2
2121
mt.showPanel();
22-
//set the size to 100
22+
//Set the size to 100 --#5.4
2323
int size = 100;
24-
//add three turtles HINT: FOR loop which 'does an action'
24+
//Add your three turtles HINT: FOR loop which 'does an action' --#2.2
2525
for (int i = 1; i <= 3; i++)
2626
{
27-
//create a turtle
27+
//Create your turtle --#2.4
2828
Turtle turtle = new Turtle();
29-
//add the turtles to the container for turtles
29+
//Add your turtles to your turtle container --#2.5
3030
turtles.add(turtle);
31+
//Repeat --#2.2
3132
}
32-
//add all turtles to the window HINT: Use a foreach loop
33+
//Add your turtles to your window HINT: Use a foreach loop --#3.1
3334
for (Turtle turtle : turtles)
3435
{
35-
//NOTE: must call addTurtle BEFORE calling other methods
36-
//add all turtles to the window
36+
//Must call addTurtle BEFORE calling other methods --INFO
37+
//Add your turtles to your window --#3.3
3738
mt.addTurtle(turtle);
39+
//Repeat --#3.2
3840
}
39-
//teleport all turtles on the window HINT: Use a FOR loop and ZERO
41+
//Teleport your turtles around your window HINT: Use a FOR loop and ZERO --#4.1
4042
for (int i = 0; i < 3; i++)
4143
{
42-
//set the X position to i*100 + 350
44+
//Get your turtle's current position and then set the X position to i*100 + 350 --#4.3
4345
turtles.get(i).setX(i * 100 + 350);
44-
//set the Y position to i*100 + 100
46+
//Get your turtle's current position and then set the Y position to i*100 + 100 --#4.4
4547
turtles.get(i).setY(i * 100 + 100);
48+
//Repeat --#4.2
4649
}
47-
//set some values for all turtles HINT: Use a foreach loop
50+
//Set some values for your turtles HINT: Use a foreach loop --#5.1
4851
for (Turtle turtle : turtles)
4952
{
50-
//set the speed of all turtle's to 7
53+
//Set the speed of your turtles to 7 --#5.3
5154
turtle.setSpeed(7);
52-
//have every turtle draw a star of the current size
55+
//Have every turtle draw a star of the current size --#5.4
5356
turtle.drawStar(size);
57+
//Repeat --#5.2
5458
}
5559
}
5660
public static void main(String[] args)

src/org/teachingkidsprogramming/section07events/ManyAnimals.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ public ManyAnimals()
66
{
77
showSomeTurtles();
88
}
9-
//create container for Turtles HINT: Use ArrayList --#2.1
10-
//create a window for many turtles HINT: Use MultiTurtlePanel --#1.1
9+
//Create a container to hold your turtles HINT: Use ArrayList --#2.1
10+
//Create a window to show your turtles HINT: Use MultiTurtlePanel --#1.1
1111
private void showSomeTurtles()
1212
{
13-
//show the panel --#1.2
14-
//set the size to 100 --#5.4
15-
//add three turtles HINT: FOR loop which 'does an action' --#2.2
16-
//create a turtle --#2.4
17-
//add the turtles to the container for turtles --#2.5
18-
//repeat --#2.2
19-
//add all turtles to the window HINT: Use a foreach loop --#3.1
20-
//NOTE: must call addTurtle BEFORE calling other methods --#3.3
21-
//add all turtles to the window --#3.4
22-
//repeat --#3.2
23-
//teleport all turtles on the window HINT: Use a FOR loop and ZERO --#4.1
24-
//set the X position to i*100 + 350 --#4.3
25-
//set the Y position to i*100 + 100 --#4.4
26-
//repeat --#4.2
27-
//set some values for all turtles HINT: Use a foreach loop --#5.1
28-
//set the speed of all turtle's to 7 --#5.3
29-
//have every turtle draw a star of the current size --#5.4
30-
//repeat --#5.2
13+
//Show your panel --#1.2
14+
//Set the size to 100 --#5.4
15+
//Add your three turtles HINT: FOR loop which 'does an action' --#2.2
16+
//Create your turtle --#2.4
17+
//Add your turtles to your turtle container --#2.5
18+
//Repeat --#2.2
19+
//Add your turtles to your window HINT: Use a foreach loop --#3.1
20+
//Must call addTurtle BEFORE calling other methods --INFO
21+
//Add your turtles to your window --#3.3
22+
//Repeat --#3.2
23+
//Teleport your turtles around your window HINT: Use a FOR loop and ZERO --#4.1
24+
//Get your turtle's current position and then set the X position to i*100 + 350 --#4.3
25+
//Get your turtle's current position and then set the Y position to i*100 + 100 --#4.4
26+
//Repeat --#4.2
27+
//Set some values for your turtles HINT: Use a foreach loop --#5.1
28+
//Set the speed of your turtles to 7 --#5.3
29+
//Have every turtle draw a star of the current size --#5.4
30+
//Repeat --#5.2
3131
}
3232
public static void main(String[] args)
3333
{

0 commit comments

Comments
 (0)