File tree Expand file tree Collapse file tree 5 files changed +97
-5
lines changed
src/main/java/org/teachingkidsprogramming/recipes/completed/section01forloops/KataQuestions Expand file tree Collapse file tree 5 files changed +97
-5
lines changed Original file line number Diff line number Diff line change 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 number Diff line number Diff line change 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 number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 33import org .teachingextensions .logo .Tortoise ;
44import 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 {
Original file line number Diff line number Diff line change 33import org .teachingextensions .logo .Tortoise ;
44import 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 {
You can’t perform that action at this time.
0 commit comments