Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import Media.*;
  2. import static java.lang.Math.*;
  3. import static java.awt.Color.*;
  4.  
  5. /*
  6. * This class will make a staircase
  7. * Made By: Jonathan Cairns
  8. *
  9. * September 18 2019
  10. * */
  11.  
  12. public class Staircase {
  13.  
  14. private TurtleDisplayer display;
  15. private Turtle yertle;
  16.  
  17. public Staircase() {
  18.  
  19. display = new TurtleDisplayer();
  20. yertle = new Turtle();
  21. display.placeTurtle(yertle);
  22.  
  23. int go = 5;
  24. int length = 10;
  25. yertle.penDown();
  26.  
  27. for (int i=0 ; i < go ; i ++) {
  28. yertle.forward(length);
  29. yertle.right(PI/2);
  30. yertle.forward(length);
  31. yertle.left(PI/2);
  32. }
  33.  
  34. yertle.penUp();
  35.  
  36. }
  37.  
  38. public static void main (String[] args) {
  39.  
  40. Staircase s = new Staircase();
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement