Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ("Length?")
- length = read ()
- print ("Width?")
- width = read ()
- turnLeft = false
- firstLine = true
- function placeColumn(length, firstLine)
- local firstLine = firstLine
- print(firstline)
- if firstLine == true then
- for i=1,length do
- turtle.forward()
- turtle.placeDown()
- firstLine = false
- end
- else
- for i=1,length-1 do
- turtle.forward()
- turtle.placeDown()
- end
- end
- return firstLine
- end
- function changeRow (turnLeft)
- local turnLeft = turnLeft
- print(turnLeft)
- if turnLeft == true then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft ()
- turtle.placeDown()
- turnLeft = false
- else
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight ()
- turtle.placeDown()
- turnLeft = true
- end
- return turnLeft
- end
- function placeLand(firstLine, length, turnLeft, width)
- local turnLeft
- for i=1,width do
- firstLine = placeColumn(length, firstLine)
- turnLeft = changeRow(turnLeft)
- end
- end
- placeLand(firstLine, length, turnLeft, width)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement