Skip to content

Commit 3445f36

Browse files
lynnlangitjamesrcounts
authored andcommitted
new kata WheelKata for @dcoopersmith
1 parent 911754f commit 3445f36

3 files changed

Lines changed: 52 additions & 3 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package org.teachingkidsprogramming.recipes.completed.section09final;
2+
3+
import org.teachingextensions.logo.Tortoise;
4+
import org.teachingextensions.logo.utils.ColorUtils.PenColors;
5+
6+
public class WheelKata
7+
{
8+
public static void main(String[] args)
9+
{
10+
setUpTheDrawing();
11+
for (int i = 0; i < 20; i++)
12+
{
13+
drawTwoSides();
14+
Tortoise.move(150);
15+
Tortoise.turn(90);
16+
}
17+
Tortoise.move(2);
18+
}
19+
private static void setUpTheDrawing()
20+
{
21+
Tortoise.show();
22+
Tortoise.setSpeed(10);
23+
Tortoise.setY(175);
24+
Tortoise.setPenColor(PenColors.Blues.Blue);
25+
Tortoise.setPenWidth(5);
26+
}
27+
private static void drawTwoSides()
28+
{
29+
for (int i = 0; i < 2; i++)
30+
{
31+
drawASide();
32+
}
33+
}
34+
private static void drawASide()
35+
{
36+
Tortoise.move(150);
37+
Tortoise.turn(125);
38+
}
39+
}

src/main/java/org/teachingkidsprogramming/section09final/RectangleKata.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ public class RectangleKata
44
{
55
public static void main(String[] args)
66
{
7-
// Draw a rectangle
8-
// HINT: Write each step in English FIRST, then translate to Java one line at a time
9-
// TIP: Be sure to run after each line of Java to make sure it works as expected
7+
// Draw a rectangle
8+
// Write the steps to code your rectangle out in English
9+
// Translate from English to Java one line at a time
10+
// Run your code after each line of Java to make sure it works as expected
1011
}
1112
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.teachingkidsprogramming.section09final;
2+
3+
public class WheelKata
4+
{
5+
// Draw a wheel
6+
// Write the steps to code your wheel out in English
7+
// Translate from English to Java one line at a time
8+
// Run your code after each line of Java to make sure it works as expected
9+
}

0 commit comments

Comments
 (0)