aboutsummaryrefslogtreecommitdiff
path: root/challenge-096/abigail/lua/ch-1.lua
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2021-01-23 22:09:01 +0000
committerGitHub <noreply@github.com>2021-01-23 22:09:01 +0000
commitefa08f1c70928d4b4f59ee48b0014f88eca8ee89 (patch)
treea01fe9a6d4f517d19f3b54b1d85c543b38efd3b2 /challenge-096/abigail/lua/ch-1.lua
parentd233c279f0b2a12111925caeb4298f2884f3d5f1 (diff)
parent1c9975a4c79a02569f92310cf5e30ccd2b542033 (diff)
downloadperlweeklychallenge-club-efa08f1c70928d4b4f59ee48b0014f88eca8ee89.tar.gz
perlweeklychallenge-club-efa08f1c70928d4b4f59ee48b0014f88eca8ee89.tar.bz2
perlweeklychallenge-club-efa08f1c70928d4b4f59ee48b0014f88eca8ee89.zip
Merge pull request #3357 from Abigail/abigail/week-096
Abigail/week 096
Diffstat (limited to 'challenge-096/abigail/lua/ch-1.lua')
-rwxr-xr-x[-rw-r--r--]challenge-096/abigail/lua/ch-1.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/challenge-096/abigail/lua/ch-1.lua b/challenge-096/abigail/lua/ch-1.lua
index 9c4b1de913..c2de0434f6 100644..100755
--- a/challenge-096/abigail/lua/ch-1.lua
+++ b/challenge-096/abigail/lua/ch-1.lua
@@ -1,9 +1,19 @@
+#!/opt/local/bin/lua
+
+--
+-- See ../README.md
+--
+
+--
+-- Run as: lua ch-1.lua < input-file
+--
+
for line in io . lines () do
--
-- Extract words and put them into an array, in reverse.
--
local words = {}
- for str in string . gmatch (line, "[^ ]+") do
+ for str in string . gmatch (line, "[^%s]+") do
table . insert (words, 1, str)
end