Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function forward(number)
- for i=1, number do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- if turtle.detectUp() then
- turtle.digUp()
- end
- if turtle.detectDown() then
- turtle.digDown()
- end
- end
- end
- function MoveDown(local numberTiles)
- for i=1, numberTiles do
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- end
- end
- write("How wide is the room?")
- local width = tonumber(read())
- local halfwidth = width/2
- write("How long is the room?")
- local length = tonumber(read())
- turtle.turnLeft()
- forward(halfwidth)
- turtle.turnRight()
- for i=1, halfwidth do
- forward(length)
- turtle.turnRight()
- if turtle.detect() then
- turtle.dig()
- forward(1)
- turtle.turnRight()
- forward(length)
- turtle.turnLeft()
- forward(1)
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement