Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require "robot"
- local component = require "component"
- local gpu = component.gpu
- local w, h = 50, 16
- function drawGUI()
- gpu.fill(1, 1, w, h, " ")
- gpu.set(1, 1, "┌" .. string.rep("─", w - 2) .. "┐")
- gpu.set(1, h, "└" .. string.rep("─", w - 2) .. "┘")
- for i = 2, h - 1 do
- gpu.set(1, i, "│")
- gpu.set(w, i, "│")
- end
- gpu.set(3, 2, "Робот " .. robot.name() .. " запущен!")
- end
- drawGUI()
- while true do
- local mine, temp = robot.detect()
- if mine then
- robot.swing()
- end
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement