Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.teachingkidsprogramming.section02methods;

import org.teachingextensions.logo.Tortoise;
import org.teachingkidsprogramming.recipes.quizzes.graders.HousesQuizAdapter;
import org.teachingkidsprogramming.recipes.quizzes.graders.HousesQuizGrader;

Expand All @@ -10,31 +11,35 @@ public void questions1Thru6()
// Question 1
// small (recipe below)
// ------------- Recipe for small
length = 7;
small();
// ------------- End of small recipe
//
// Question2
// medium (recipe below)
// ------------- Recipe for medium
// set the current length to 21
medium();
// ------------- End of medium recipe
//
// Question3
// large (recipe below)
// ------------- Recipe for large
// set the current length to 63
large();
// ------------- End of large recipe
//
// Question4
// moveTheLength (recipe below)
// ------------- Recipe for moveTheLength
// move the Tortoise the current length
moveTheLength();
// ------------- End of moveTheLength recipe
//
// Question5
// turnTheCorner (recipe below)
// ------------- Recipe for turnTheCorner
// turn the Tortoise 1/3 of 360 degrees to the left
turnTheCorner();
// ------------- End of turnTheCorner recipe
//
// Question6
Expand All @@ -43,6 +48,30 @@ public void questions1Thru6()
// call moveTheLength and turnTheCorner
// ------------- End of drawASide recipe
}
private void turnTheCorner()
{
Tortoise.turn(-120);
}
private void moveTheLength()
{
Tortoise.move(length);
}
private void large()
{
length = 63;
}
private void medium()
{
length = 21;
}
private void medium()
{
medium();
}
private void small()
{
length = 7;
}
public static void main(String[] args)
{
new HousesQuizGrader().grade(new HousesQuiz());
Expand Down