example.turtlelogo.TwoTurtles Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of turtle-logo Show documentation
Show all versions of turtle-logo Show documentation
Java-based turtle logo for introductory programming courses
The newest version!
package example.turtlelogo;
import org.gannacademy.cdf.turtlelogo.AnimatedTurtle;
import org.gannacademy.cdf.turtlelogo.Turtle;
import java.awt.*;
public class TwoTurtles {
public static void main(String[] args) {
Turtle
michelangeo = new AnimatedTurtle(),
leonardo = new AnimatedTurtle();
michelangeo.getTerrarium().setSize(800, 400);
michelangeo.tp(200, 200);
michelangeo.pc(Color.orange);
michelangeo.lt(120);
michelangeo.fd(100);
michelangeo.lt(120);
michelangeo.fd(100);
michelangeo.lt(120);
michelangeo.fd(100);
leonardo.tp(600, 200);
leonardo.pc(Color.blue);
leonardo.fd(100);
leonardo.lt(90);
leonardo.fd(100);
leonardo.lt(90);
leonardo.fd(100);
leonardo.lt(90);
leonardo.fd(100);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy