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,17 +1,26 @@
package org.teachingkidsprogramming.section01forloops;

import org.teachingextensions.logo.Tortoise;
import org.teachingextensions.logo.utils.ColorUtils.PenColors;

public class SimpleSquare
{
public static void main(String[] args) throws Exception
{
// Show the tortoise --#1
// Make the tortoise move as fast as possible --#6
// Do the following 4 times --#5.1
// Change the pen color of the line the tortoise draws to blue --#4
// Move the tortoise 50 pixels --#2
// Turn the tortoise to the right (90 degrees) --#3
Tortoise.show();
for (int i = 0; i < 4; i++)
{
// Make the tortoise move as fast as possible --#6
// Do the following 4 times --#5.1
// Change the pen color of the line the tortoise draws to blue --#4
Tortoise.setPenColor(PenColors.Blues.Blue);
// Move the tortoise 50 pixels --#2
Tortoise.move(50);
// Turn the tortoise to the right (90 degrees) --#3
Tortoise.turn(90);
}
// Repeat --#5.2
//
// (Optional): Sign your work using the Virtual Proctor
// See your work at http://virtualproctor.tkpjava.org
}
Expand Down