diff options
Diffstat (limited to 'challenge-078/stuart-little/lua/ch-1.lua')
| -rwxr-xr-x | challenge-078/stuart-little/lua/ch-1.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-078/stuart-little/lua/ch-1.lua b/challenge-078/stuart-little/lua/ch-1.lua new file mode 100755 index 0000000000..1b76fe7c70 --- /dev/null +++ b/challenge-078/stuart-little/lua/ch-1.lua @@ -0,0 +1,13 @@ +#!/usr/bin/env lua + +-- run <script> <space-separated numbers> + +local mx = tonumber(arg[#arg]) +local out = {mx} +for i=#arg-1,1,-1 do + if tonumber(arg[i]) > mx then + mx = tonumber(arg[i]) + table.insert(out,1,mx) + end +end +print(table.unpack(out)) |
