local robot = require("robot") local event = require("event") print("Control using w,s,q,e. Exit using c") while true do local _, _, ascii, _, _ = event.pull("key_down") local ch = string.char(ascii) if ch == 'q' then robot.turnLeft() elseif ch == 'e' then robot.turnRight() elseif ch == 'w' then robot.forward() elseif ch == 's' then robot.back() elseif ch == 'c' then break end end