25 lines
339 B
Plaintext
25 lines
339 B
Plaintext
|
|
-- helper functions
|
|
|
|
function isNumber(token: string): boolean
|
|
if tonumber(token) ~= nil then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
for line in io.lines() do
|
|
local tokens = {}
|
|
for token in line:gmatch("%S+") do
|
|
table.insert(tokens, token)
|
|
end
|
|
for idx, val in ipairs(tokens) do
|
|
print(idx, val, isNumber(val))
|
|
end
|
|
end
|
|
|