Skip to content

Commit 8137459

Browse files
committed
added line number w/Matt
1 parent 8c841b3 commit 8137459

6 files changed

Lines changed: 63 additions & 32 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package org.teachingkidsprogramming.recipes.completed;
2+
3+
import org.teachingextensions.simpleparser.Parser;
4+
import org.teachingkidsprogramming.recipes.quizzes.graders.AdLibsQuizAdapter;
5+
import org.teachingkidsprogramming.recipes.quizzes.graders.AdLibsQuizGrader;
6+
7+
public class AdLibsQuiz extends AdLibsQuizAdapter
8+
{
9+
public void question1(String letter1, String letter3)
10+
{
11+
//set current value of word1 to be letter1 + 'o' + letter3
12+
word1 = letter1 + "o" + letter3;
13+
}
14+
public void question2(String letter1)
15+
{
16+
//add the letter1 to the end of word2
17+
word2 = word2 + letter1;
18+
}
19+
public void question3(String templateText, Object model)
20+
{
21+
//use the parser to combine the template and the model as word3
22+
word3 = Parser.parse(templateText, model);
23+
}
24+
public void question4(Pieces pieces)
25+
{
26+
//set template4 to the template which does'g' + pieces.middle + 'e'
27+
template4 = "g" + pieces.middle + "e";
28+
}
29+
public static void main(String[] args)
30+
{
31+
new AdLibsQuizGrader().grade(new AdLibsQuiz());
32+
}
33+
}

src/org/teachingkidsprogramming/recipes/completed/BackgroundPhoto.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static void main(String[] args)
1717
Tortoise.getBackgroundWindow().setBackgroundImage(picture);
1818
// Set the current side to 2 pixels long --#4.1
1919
int side = 2;
20-
// Do the following 75 times --#2
20+
// Do the following 75 times --#2.1
2121
for (int i = 1; i <= 75; i++)
2222
{
2323
// Set the current pen color to crimson --#8.1
@@ -36,7 +36,7 @@ public static void main(String[] args)
3636
Tortoise.turn(360 / 4);
3737
// Turn the tortoise 1 more degree --#6
3838
Tortoise.turn(1);
39-
// Repeat
39+
// Repeat --#2.2
4040
}
4141
}
4242
}

src/org/teachingkidsprogramming/section04mastery/BackgroundPhoto.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static void main(String[] args)
88
// Set the current picture to this url "http://img2.timeinc.net/ew/dynamic/imgs/101110/sonny-cher_240.jpg" --#7.1
99
// Set the background image to the current picture--#7.2
1010
// Set the current side to 2 pixels long --#4.1
11-
// Do the following 75 times --#2
11+
// Do the following 75 times --#2.1
1212
// Set the current pen color to crimson --#8.1
1313
// Use the current pen color for the line the tortoise draws --#8.2
1414
// Increase the length of a side by 1 pixel --#5
@@ -17,6 +17,6 @@ public static void main(String[] args)
1717
// Set the Y position of the tortoise to 65 pixels --#4.4
1818
// Turn the tortoise 1/3rd of 360 degrees to the right --#1
1919
// Turn the tortoise 1 more degree --#6
20-
// Repeat
20+
// Repeat --#2.2
2121
}
2222
}

src/org/teachingkidsprogramming/section07events/ConnectTheDots.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.teachingkidsprogramming.section07events;
22

3+
import org.teachingextensions.logo.Tortoise;
34
import org.teachingextensions.windows.MouseLeftClickListener;
45
import org.teachingextensions.windows.MouseRightClickListener;
56

@@ -8,11 +9,13 @@ public class ConnectTheDots implements MouseRightClickListener, MouseLeftClickLi
89
public static void main(String[] args)
910
{
1011
//Create a new 'Connect The Dots' window. --#1.1
12+
ConnectTheDots dots = new ConnectTheDots();
1113
}
1214
public ConnectTheDots()
1315
{
1416
// Listen for right clicks on the window for the tortoise --#20.2
1517
// Listen for left clicks on the window for the tortoise --#1.2
18+
Tortoise.getBackgroundWindow().addMouseRightClickListener(this);
1619
//Make the Tortoise go as fast as possible. --#4
1720
// clearTheScreen (recipe below) --#19
1821
// ------------- Recipe for clearTheScreen --#19

src/org/teachingkidsprogramming/section07events/OldSimpleBubbleQuiz.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/org/teachingkidsprogramming/section07events/SimpleBubbleQuiz.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,27 @@ public static void main(String[] args)
2626
{
2727
new SimpleBubbleQuizGrader().grade(new SimpleBubbleQuiz());
2828
}
29+
//this is the original quiz (from SmallBasic) - need to be translated to Java
30+
//Variables needed for Quiz
31+
// action[1] = 15
32+
// ball = 1
33+
// BubbleQuiz.StartQuizAt = Question2
34+
//--------------------Begin Quiz --------------------
35+
//Question1 - Is At the bottom of this quiz. But do it 1st!
36+
// Sub Question2
37+
// Set the 1st action to 5
38+
// EndSub
39+
// Sub Question3
40+
//Have the timer call Move every 100 milliseconds
41+
// EndSub
42+
// Sub Question4
43+
// Set the 2nd action to -6
44+
// EndSub
45+
// Sub Question5
46+
//Change the color for the next circle to be yellow
47+
//Make the current ball be a circle with a 11 pixel radius
48+
// EndSub
49+
//Question1
50+
//Create a subroutine called Move
51+
// that calls Quiz.DoMovement()
2952
}

0 commit comments

Comments
 (0)