Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local r = require("robot")
- local function place()
- r.swingUp()
- r.swing()
- r.swingDown()
- r.placeDown()
- end
- function move(m)
- i=1
- while i<=m do
- place()
- if r.forward()==true then
- i=i+1
- end
- end
- end
- function cicl()
- move(a)
- r.turnRight()
- move(1)
- r.turnRight()
- move(a)
- if not (q == (c+1)) then
- r.turnLeft()
- move(1)
- r.turnLeft()
- end
- end
- function shah()
- while q <= c do
- q=q+1
- cicl()
- end
- move(1)
- r.turnRight()
- move((c*2)+1)
- r.turnRight()
- end
- print("постройка платформы.")
- print("Введите длину платформы:")
- a = io.read() - 1
- print("Введите ширину:")
- c = (io.read() / 2) - 1
- q = 0
- shah()
- q = 0
- while (b =="Y") or (b == "y") do
- shah()
- q = 0
- end
Advertisement
Add Comment
Please, Sign In to add comment