diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2021-07-16 13:17:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-16 13:17:28 +0100 |
| commit | 93e61f41948cb7e7bf309a45cb4001e036e8dc91 (patch) | |
| tree | b637938e355260c1727f7cb9e5c29aeb56b52bf6 /challenge-031/stuart-little/lua | |
| parent | 725be357a015b22d8edf035f1d98002e7e1dd2fc (diff) | |
| parent | f7c64a3c642ccafe8759c79b6da39b59af62da01 (diff) | |
| download | perlweeklychallenge-club-93e61f41948cb7e7bf309a45cb4001e036e8dc91.tar.gz perlweeklychallenge-club-93e61f41948cb7e7bf309a45cb4001e036e8dc91.tar.bz2 perlweeklychallenge-club-93e61f41948cb7e7bf309a45cb4001e036e8dc91.zip | |
Merge pull request #4530 from stuart-little/stuart-little_031_lua
1st commit on 031_lua
Diffstat (limited to 'challenge-031/stuart-little/lua')
| -rwxr-xr-x | challenge-031/stuart-little/lua/ch-1.lua | 6 | ||||
| -rwxr-xr-x | challenge-031/stuart-little/lua/ch-2.lua | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/challenge-031/stuart-little/lua/ch-1.lua b/challenge-031/stuart-little/lua/ch-1.lua new file mode 100755 index 0000000000..90ec6bd6a9 --- /dev/null +++ b/challenge-031/stuart-little/lua/ch-1.lua @@ -0,0 +1,6 @@ +#!/usr/bin/env lua + +-- run <script> <numerator> <denominator> + +local frac=arg[1]/arg[2] +print((frac ~=frac or frac==math.huge or frac==-math.huge) and "divided by zero" or frac) diff --git a/challenge-031/stuart-little/lua/ch-2.lua b/challenge-031/stuart-little/lua/ch-2.lua new file mode 100755 index 0000000000..fa840c94ef --- /dev/null +++ b/challenge-031/stuart-little/lua/ch-2.lua @@ -0,0 +1,7 @@ +#!/usr/bin/env lua + +-- run <script> <variable name> + +_G[arg[1]]=math.random() +print("Your variable:") +print(arg[1]..": ".._G[arg[1]]) |
