Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not turtle then return print "LOL, how are you going to use this program without a turtle?!?" end
- print "how long platform?"
- longplat = read()
- print "how wide platform?"
- wideplat = read()
- print "what way to turn first? ( right - left )"
- firstturn = read()
- print "how many layers?"
- layers = read()
- first = true
- if firstturn == "right" or firstturn == "left" then nextturn = firstturn
- else return print "Error with first turn!"
- end
- function gotoStart()
- longplat2 = longplat - 2
- wideplat2 = wideplat - 2
- turtle.turnLeft()
- turtle.turnLeft()
- for n1 = 0,longplat2 do
- turtle.forward()
- end
- if nextturn == "left" then
- turtle.turnLeft()
- else turtle.turnRight()
- end
- for n1 = 0,wideplat2 do
- turtle.forward()
- end
- if nextturn == "left" then
- turtle.turnLeft()
- else turtle.turnRight()
- end
- end
- function layer()
- while true do
- if first == true then
- first = false
- longplat1 = longplat
- wideplat1 = wideplat
- longplat1 = longplat1 - 1
- end
- wideplat1 = wideplat1 - 1
- for n1 = 1,longplat1 do
- turtle.placeDown()
- turtle.forward()
- turtle.placeDown()
- end
- if wideplat1 == 0 then break end
- if nextturn == "left" then
- nextturn = "right"
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- elseif nextturn == "right" then
- nextturn = "left"
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- turtle.placeDown()
- end
- end
- for n2 = 1,layers do
- turtle.up()
- layer()
- gotoStart()
- first = true
- end
- turtle.down()
Advertisement
Add Comment
Please, Sign In to add comment