Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --define--
- x = -253
- y = 98
- z = 303
- tx = -270
- ty = 89
- tz = 310
- height = 102
- rotation = 3
- ----------
- --functions--
- function rotate(w)
- while rotation ~= w do
- rotation = rotation + 1
- turtle.turnRight()
- if rotation == 5 then
- rotation = 1
- end
- end
- end
- function GoX(cx,gx)
- if cx > gx then
- rotate(4)
- for i = cx, gx + 1, -1 do
- turtle.forward()
- print("gox>")
- end
- elseif cx < gx then
- rotate(2)
- for i = cx, gx - 1 do
- turtle.forward()
- print("gox<")
- end
- end
- end
- function GoY(cy,gy)
- if cy > gy then
- for i = cy, gy - 1, -1 do
- turtle.down()
- print("goy>")
- end
- elseif cy < gy then
- for i = cy, gy - 1 do
- turtle.up()
- print("goy<")
- end
- end
- end
- function GoZ(cz,gz)
- print("atleast it called")
- if cz > gz then
- rotate(1)
- for i = cz, gz+1, -1 do
- turtle.forward()
- print(i)
- end
- elseif cz < gz then
- rotate(3)
- for i = cz, gz - 1 do
- turtle.forward()
- print(i)
- end
- end
- end
- function Drop()
- end
- -------------
- --main--
- GoY(y,height)
- GoX(x,tx)
- GoZ(z,tz)
- GoY(height,ty)
- --------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement