aboutsummaryrefslogtreecommitdiff
path: root/challenge-153/abigail/lua/ch-1.lua
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-153/abigail/lua/ch-1.lua')
-rw-r--r--challenge-153/abigail/lua/ch-1.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/challenge-153/abigail/lua/ch-1.lua b/challenge-153/abigail/lua/ch-1.lua
new file mode 100644
index 0000000000..6954a9c0a0
--- /dev/null
+++ b/challenge-153/abigail/lua/ch-1.lua
@@ -0,0 +1,22 @@
+#!/opt/local/bin/lua
+
+--
+-- See https://theweeklychallenge.org/blog/perl-weekly-challenge-153
+--
+
+--
+-- Run as: lua ch-1.lua
+--
+
+local sum = 1
+local fac = 1
+
+io . write (sum)
+
+for n = 1, 9 do
+ fac = fac * n
+ sum = sum + fac
+ io . write (" ", sum)
+end
+
+io . write ("\n")