moverperfect

eepyramid

Oct 4th, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. function place(n)
  2.     turtle.select(n)
  3.     turtle.placeDown()
  4. end
  5. function fwd(n)
  6.     if n == nil do
  7.         n=1
  8.     end
  9.     for i=1, n do
  10.         turtle.forward()
  11.     end
  12. end
  13. function placeFwd(n)
  14.     place(n)
  15.     fwd()
  16. end
  17. function pyr()
  18.     turtle.up()
  19.     placeFwd(1)
  20.     placeFwd(2)
  21.     place(3)
  22.     turtle.turnRight()
  23.     turtle.turnRight()
  24.     fwd(3)
  25.     placeFwd(2)
  26.     place(3)
  27.     turtle.turnRight()
  28.     turtle.forward()
  29.     turtle.turnRight()
  30.     turtle.down()
  31.     placeFwd(4)
  32.     place(5)
  33.     turtle.up()
  34.     placeFwd(3)
  35.     placeFwd(2)
  36.     place(3)
  37.     turtle.turnLeft()
  38.     fwd()
  39.     turtle.turnLeft()
  40.     fwd()
  41.     place(3)
  42.     -- Done first half off bottom layer
  43.     turtle.turnLeft()
  44.     fwd(4)
  45.     place(3)
  46.     turtle.turnLeft()
  47.     fwd()
  48.     turtle.turnLeft()
  49.     fwd()
  50.     place(3)
  51.     turtle.turnLeft()
  52.     fwd()
  53.     placeFwd(2)
  54.     place(3)
  55.     -- Finished Bottom layer, now doing 2nd layer
  56.     turtle.up()
  57.     turtle.turnLeft()
  58.     turtle.turnLeft()
  59.     fwd()
  60.     placeFwd(3)
  61.     turtle.turnLeft()
  62.     fwd()
  63.     place(3)
  64.     turtle.turnLeft()
  65.     fwd()
  66.     placeFwd(2)
  67.     place(3)
  68.     turtle.turnRight()
  69.     fwd()
  70.     turtle.turnRight()
  71.     fwd()
  72.     place(3)
  73.     -- Finished 2nd layer, now on final layer
  74.     turtle.up()
  75.     turtle.turnRight()
  76.     fwd()
  77.     place(3)
  78. end
  79. pyr()
Advertisement
Add Comment
Please, Sign In to add comment