Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Media.*;
- import static java.lang.Math.*;
- import static java.awt.Color.*;
- /*
- * This class will make a staircase
- * Made By: Jonathan Cairns
- *
- * September 18 2019
- * */
- public class Staircase {
- private TurtleDisplayer display;
- private Turtle yertle;
- public Staircase() {
- display = new TurtleDisplayer();
- yertle = new Turtle();
- display.placeTurtle(yertle);
- int go = 5;
- int length = 10;
- yertle.penDown();
- for (int i=0 ; i < go ; i ++) {
- yertle.forward(length);
- yertle.right(PI/2);
- yertle.forward(length);
- yertle.left(PI/2);
- }
- yertle.penUp();
- }
- public static void main (String[] args) {
- Staircase s = new Staircase();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement