aboutsummaryrefslogtreecommitdiff
path: root/challenge-082/stuart-little/lua/ch-1.lua
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-082/stuart-little/lua/ch-1.lua')
-rwxr-xr-xchallenge-082/stuart-little/lua/ch-1.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/challenge-082/stuart-little/lua/ch-1.lua b/challenge-082/stuart-little/lua/ch-1.lua
new file mode 100755
index 0000000000..5671895075
--- /dev/null
+++ b/challenge-082/stuart-little/lua/ch-1.lua
@@ -0,0 +1,7 @@
+#!/usr/bin/env lua
+
+-- run <script> <space-separated numbers>
+
+for i=1,math.min(tonumber(arg[1]),tonumber(arg[2])) do
+ if (tonumber(arg[1]) % i == 0) and (tonumber(arg[2]) % i == 0) then print(i) end
+end