example.turtlelogo.House 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 House {
public static void main(String[] args) {
Turtle rafael = new AnimatedTurtle();
int size = 100;
rafael.pu();
rafael.bk(size / 2.0);
rafael.pd();
rafael.pw(4);
rafael.pc(Color.red);
rafael.fd(size);
rafael.lt(135);
rafael.fd(Math.sqrt(2) * size);
rafael.lt(135);
rafael.fd(size);
rafael.lt(135);
rafael.fd(Math.sqrt(2) * size);
rafael.lt(90);
rafael.fd(Math.sqrt(2) * size / 2.0);
rafael.lt(90);
rafael.fd(Math.sqrt(2) * size / 2.0);
rafael.lt(135);
rafael.fd(size);
rafael.rt(90);
rafael.fd(size);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy