Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables
- length = 6 --The length of the inner area of the arena, only even numbers.
- side = "right" --Leave this alone.
- rows = 3 --Use half the rows, can only handle whole numbers.
- --Functions
- function start() -- Controlling the movement and places blocks.
- for i = 1,rows do
- place()
- move()
- navigateRight()
- place()
- move()
- navigateLeft()
- end
- end
- function home() -- Sends the turtle home, must be used after start() is done.
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.back()
- end
- function navigateRight() -- Handles the turtles navigation to the right.
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- place()
- end
- function navigateLeft() -- Handles the turtles navigation to the left.
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- place()
- end
- function move() -- Places a block and then moves the turtle forward.
- for i = 1,length do
- place()
- turtle.forward()
- end
- end
- function place() -- Handles the placement of blocks.
- if turtle.detectUp() == false then
- turtle.placeUp()
- else
- turtle.forward()
- end
- end
- -- Code to be executed
- start()
- home()
Advertisement
Add Comment
Please, Sign In to add comment