Skip to content

Commit f03cc5d

Browse files
committed
wrote more kata questions w/@dcoopersmith
section 1 kata questions
1 parent 5cfb054 commit f03cc5d

File tree

5 files changed

+97
-5
lines changed

5 files changed

+97
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.teachingkidsprogramming.recipes.completed.section01forloops.KataQuestions;
2+
3+
import org.teachingextensions.logo.Tortoise;
4+
import org.teachingextensions.logo.utils.ColorUtils.PenColors;
5+
6+
//------------Kata Question---------------//
7+
// How would you make a hexagon...
8+
// with 20px thick sides...
9+
// and with randomly colored lines
10+
// and with side lengths of 25 that increase by 2x?
11+
//
12+
// Write out the steps in English
13+
// Then translate the steps into code
14+
// Make sure to run after each line
15+
//
16+
public class SquareToIncreasingThickHexagonMultiColor_05
17+
{
18+
public static void main(String[] args) throws Exception
19+
{
20+
Tortoise.show();
21+
Tortoise.setSpeed(10);
22+
Tortoise.setPenWidth(20);
23+
int sides = 7;
24+
for (int i = 0; i < sides; i++)
25+
{
26+
Tortoise.setPenColor(PenColors.getRandomColor());
27+
Tortoise.move(50);
28+
Tortoise.turn(360 / sides);
29+
}
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.teachingkidsprogramming.recipes.completed.section01forloops.KataQuestions;
2+
3+
import org.teachingextensions.logo.Tortoise;
4+
import org.teachingextensions.logo.utils.ColorUtils.PenColors;
5+
6+
//------------Kata Question---------------//
7+
// How would you make an equilateral hexagon...
8+
// with 20px thick sides...
9+
// and with randomly colored lines?
10+
//
11+
// Write out the steps in English
12+
// Then translate the steps into code
13+
// Make sure to run after each line
14+
//
15+
public class SquareToThickHexagonMultiColor_04
16+
{
17+
public static void main(String[] args) throws Exception
18+
{
19+
Tortoise.show();
20+
Tortoise.setSpeed(10);
21+
Tortoise.setPenWidth(20);
22+
int sides = 3;
23+
for (int i = 0; i < sides; i++)
24+
{
25+
Tortoise.setPenColor(PenColors.getRandomColor());
26+
Tortoise.move(50);
27+
Tortoise.turn(360 / sides);
28+
}
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.teachingkidsprogramming.recipes.completed.section01forloops.KataQuestions;
2+
3+
import org.teachingextensions.logo.Tortoise;
4+
import org.teachingextensions.logo.utils.ColorUtils.PenColors;
5+
6+
//------------Kata Question---------------//
7+
// How would you make an equilateral triangle...
8+
// with 20px thick sides...
9+
// and with randomly colored lines?
10+
//
11+
// Write out the steps in English
12+
// Then translate the steps into code
13+
// Make sure to run after each line
14+
//
15+
public class SquareToThickTriangleMultiColor_03
16+
{
17+
public static void main(String[] args) throws Exception
18+
{
19+
Tortoise.show();
20+
Tortoise.setSpeed(10);
21+
Tortoise.setPenWidth(20);
22+
int sides = 3;
23+
for (int i = 0; i < sides; i++)
24+
{
25+
Tortoise.setPenColor(PenColors.Blues.Blue);
26+
Tortoise.move(50);
27+
Tortoise.turn(360 / sides);
28+
}
29+
}
30+
}

src/main/java/org/teachingkidsprogramming/recipes/completed/section01forloops/KataQuestions/SimpleSquareKataQuestionThickTriangle.java renamed to src/main/java/org/teachingkidsprogramming/recipes/completed/section01forloops/KataQuestions/SquareToThickTriangle_02.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
import org.teachingextensions.logo.Tortoise;
44
import org.teachingextensions.logo.utils.ColorUtils.PenColors;
55

6-
//
76
//------------Kata Question---------------//
8-
// How would you make a triangle with 20px thick sides?
7+
// How would you make an equilateral triangle...
8+
// with 20px thick sides?
9+
//
910
// Write out the steps in English
1011
// Then translate the steps into code
1112
// Make sure to run after each line
1213
//
13-
public class SimpleSquareKataQuestionThickTriangle
14+
public class SquareToThickTriangle_02
1415
{
1516
public static void main(String[] args) throws Exception
1617
{

src/main/java/org/teachingkidsprogramming/recipes/completed/section01forloops/KataQuestions/SimpleSquareKataQuestionTriangle.java renamed to src/main/java/org/teachingkidsprogramming/recipes/completed/section01forloops/KataQuestions/SquareToTriangle_01.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import org.teachingextensions.logo.Tortoise;
44
import org.teachingextensions.logo.utils.ColorUtils.PenColors;
55

6-
//
76
//------------Kata Question---------------//
87
// How would you make an equilateral triangle?
8+
//
99
// Write out the steps in English
1010
// Then translate the steps into code
1111
// Make sure to run after each line
1212
//
13-
public class SimpleSquareKataQuestionTriangle
13+
public class SquareToTriangle_01
1414
{
1515
public static void main(String[] args) throws Exception
1616
{

0 commit comments

Comments
 (0)