Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args={...}
- inNum=1
- turtle.select(inNum)
- function place()
- turtle.select(inNum)
- if turtle.getItemCount(inNum)==0 then
- inNum=inNum+1
- turtle.select(inNum)
- end
- if not turtle.detect() then
- turtle.placeDown()
- end
- end
- function placeAndMoveX(wx)
- for x=1,wx do
- turtle.forward()
- place()
- end
- end
- if table.getn(args)~=2 then
- print("please insert x and y arguments")
- else
- wx=tonumber(args[1])
- wy=tonumber(args[2])
- turtle.forward()
- place()
- for y=1,wy do
- placeAndMoveX(wx-1)
- if y<wy then
- if y%2==1 then
- turtle.turnRight()
- turtle.forward()
- place()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.forward()
- place()
- turtle.turnLeft()
- end
- end
- end
- end
- --getItemCount(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement