aboutsummaryrefslogtreecommitdiff
path: root/challenge-073/stuart-little/lua/ch-2.lua
blob: 6b86f6e4e87669e9f6bfd6281058630d7cf9d211 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env lua

-- run <script> <space-separated numbers>

local out,run={}
for k,v in ipairs(arg) do
   table.insert(out,(((not run) and 0) or (tonumber(v)<=run and 0) or (run)))
   run=run and run <= tonumber(v) and run or tonumber(v)
end

print(table.unpack(out))