add robot prototype

This commit is contained in:
Redo 2022-10-28 16:14:32 -06:00
parent 96b1015e53
commit 5ecd2ce020

View File

@ -7,9 +7,11 @@ local function intToPort(gate, port, len, v)
end
return function(gate, argv)
print(table.concat(argv, "|\n"))
print("robot input")
print("\""..argv[1].."\"")
for word in argv[1]:gmatch("[^\t]+") do
local arg = argv[1]:gsub("^ +", ""):gsub(" +$", "")
print("\""..arg.."\"")
for word in arg:gmatch("[^\t]+") do
local first, rest = word:sub(1, 1), word:sub(2, #word)
local vec = {}
for a in rest:gmatch("[^ ]+") do table.insert(vec, tonumber(a) or error("invalid number "..a)) end