Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --pentacubee
- local robot = require("robot")
- offset = 10
- size = 5
- --functions
- function gotocorner (r)
- for i = 1,r,1
- do
- robot.forward()
- end
- robot.turnRight()
- for i = 1,r,1
- do
- robot.forward()
- end
- robot.turnRight()
- end
- function makeplane (size)
- local spiral = size - 1
- while spiral > 0
- do
- for side = 1,4,1
- do
- for i = 1,spiral,1
- do
- robot.placeDown()
- if i < spiral then robot.forward() end
- end
- if side < 4 then robot.forward() end
- robot.turnRight()
- end
- robot.forward()
- spiral = spiral - 2
- end
- robot.placeDown()
- end
- function makewalls (size)
- for side = 1,4,1
- do
- for i = 1,size,1
- do
- robot.placeDown()
- if i < size then robot.forward() end
- end
- robot.turnRight()
- end
- end
- --move to field
- for i = 1,offset,1
- do
- robot.forward()
- end
- --go to starting corner for floor
- gotocorner(size / 2)
- --build floor
- robot.select(4)
- robot.up()
- makeplane(size)
- --go to starting corner for walls
- gotocorner(size / 2)
- --build walls
- for f = 1,size - 2,1
- do
- robot.select(4+f)
- robot.up()
- makewalls(size)
- if f == 2 then
- for z = 1,2,1
- do
- robot.forward()
- end
- robot.turnRight()
- for z = 1,2,1
- do
- robot.forward()
- end
- robot.select(13)
- robot.placeDown()
- robot.select(4+f)
- for z = 1,2,1
- do
- robot.forward()
- end
- robot.turnRight()
- for z = 1,2,1
- do
- robot.forward()
- end
- robot.turnRight()
- end
- end
- --build ceiling
- robot.up()
- robot.select(8)
- makeplane(size)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement