diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2022-02-21 17:19:10 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-21 17:19:10 +0000 |
| commit | e1575d77a4181187d7a30e2ac0df6679f4e2bd43 (patch) | |
| tree | 51018743898acda3187c467272de6e550bce031a /challenge-153/abigail/lua/ch-1.lua | |
| parent | 4579383b9f8e55ab6d85ff414b47813d8e4f9351 (diff) | |
| parent | 6d7e1942a22328ba6c83e771d113957909eaabcf (diff) | |
| download | perlweeklychallenge-club-e1575d77a4181187d7a30e2ac0df6679f4e2bd43.tar.gz perlweeklychallenge-club-e1575d77a4181187d7a30e2ac0df6679f4e2bd43.tar.bz2 perlweeklychallenge-club-e1575d77a4181187d7a30e2ac0df6679f4e2bd43.zip | |
Merge pull request #5690 from Abigail/abigail/week-153
Solutions for week 153
Diffstat (limited to 'challenge-153/abigail/lua/ch-1.lua')
| -rw-r--r-- | challenge-153/abigail/lua/ch-1.lua | 22 |
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") |
