diff options
| author | 2022-01-17 19:29:00 -0500 | |
|---|---|---|
| committer | 2022-01-17 19:29:00 -0500 | |
| commit | 226ddb38551079a325c2abe220106e65a635e4e4 (patch) | |
| tree | 2153dc3c7422c6e4a7a43f825311f2d36d03fcc0 /examples/gen.lua | |
| parent | add eof, patch parse to work with it (diff) | |
add eof to README
Diffstat (limited to 'examples/gen.lua')
| -rw-r--r-- | examples/gen.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/gen.lua b/examples/gen.lua new file mode 100644 index 0000000..6045702 --- /dev/null +++ b/examples/gen.lua @@ -0,0 +1,17 @@ +local min = 1 +local max = 100 + +if arg[1] then max = tonumber(arg[1]) end +if arg[2] then min = tonumber(arg[2]) end +-- this will get fixed in the next if + +if max < min then + min, max = max, min +elseif max == min then + max = max + 1 +end + +for i=min,max-1 do + io.write(i, '+') +end +print(max) |
