Skip to content

Commit 3d5cc03

Browse files
committed
updated HiLow w/Matt
1 parent fcbf51d commit 3d5cc03

File tree

5 files changed

+22
-12
lines changed

5 files changed

+22
-12
lines changed
0 Bytes
Binary file not shown.

TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/TriangleShell.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/ChooseYourOwnAdventure.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/HiLow.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff 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
}

TeachingKidsProgramming/src/org/teachingkidsprogramming/section08tdd/DeepDive08TDD.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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
*

0 commit comments

Comments
 (0)