aboutsummaryrefslogtreecommitdiff
path: root/examples/gen.lua
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gen.lua')
-rw-r--r--examples/gen.lua17
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)