File tree Expand file tree Collapse file tree 5 files changed +22
-12
lines changed
TeachingKidsProgramming/src
org/teachingkidsprogramming Expand file tree Collapse file tree 5 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,15 @@ public static void main(String[] args)
1010 // Do the following 60 times --#8.1
1111 // Change the pen color of the line the tortoise draws to a random color --#10
1212 // Increase the current length of the side by 4 pixels --#9
13+ //
1314 // drawTriangle (recipe below) --#6
1415 // ------------- Recipe for drawTriangle --#5
1516 // Do the following 3 times --#3.1
1617 // Move the tortoise the current length of a side --#4
1718 // Turn the tortoise 1/3rd of 360 degrees --#2
1819 // Repeat --#3.2
1920 // ------------- End of drawTriangle recipe --#5
21+ //
2022 // Turn the tortoise 1/60th of 360 degrees to the right --#11
2123 // Repeat --#8.2
2224 }
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public static void main(String[] args)
1616 // lighten the current pen color --#42
1717 // wait for 100 milliseconds --#40
1818 // Repeat --#41
19+ //
1920 // ------------- End of animateStartStory recipe --#38
2021 // Ask the user "Do you want to 'wake up' or 'explore' the dream?" --#3
2122 // If they answer "wake up" --#6
Original file line number Diff line number Diff line change @@ -5,17 +5,17 @@ public class HiLow
55 public static void main (String [] args )
66 {
77 // Choose a random number between 1 and 100 --#4.1 (fake!) & --#13
8- // Do the following 8 times --#9
9- // Ask the user for a guess --#1
10- // If the guess is correct --#4
11- // Play a bell --#2
12- // Tell the user that they won the game --#3
13- // and exit --#10
14- // Otherwise, if the guess is too high --#6
15- // Tell the end user that it is too high --#5
16- // Otherwise, if the guess is too low --#8
17- // Tell the end user that it is too low --#7
18- // If after 8 times they haven't guessed correctly then --#12
19- // Tell them they've lost the game --#11
8+ // Do the following 8 times --#9.1
9+ // Ask the user for a guess --#1
10+ // If the guess is correct --#4
11+ // Play a bell --#2
12+ // Tell the user that they won the game --#3
13+ // and exit --#10
14+ // Otherwise, if the guess is too high --#6
15+ // Tell the end user that it is too high --#5
16+ // Otherwise, if the guess is too low --#8
17+ // Tell the end user that it is too low --#7
18+ // Repeat --#9.2
19+ // After 8 incorrect guesses tell them they've lost --#11
2020 }
2121}
Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ public void theLineEndsReally() throws Exception
9797 String result = sb .toString ();
9898 Assert .assertEquals ("one end \n another end \n " , result );
9999 }
100+ @ Test
101+ public void chainThoseMethods () throws Exception
102+ {
103+ StringBuilder sb = new StringBuilder ("method" );
104+ String result = sb .reverse ().toString ();
105+ Assert .assertEquals (___ , result );
106+ }
100107 /**
101108 * Ignore the following, It's needed to run the homework
102109 *
You can’t perform that action at this time.
0 commit comments