aboutsummaryrefslogtreecommitdiff
path: root/challenge-096/abigail/lua/ch-1.lua
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-096/abigail/lua/ch-1.lua')
-rw-r--r--challenge-096/abigail/lua/ch-1.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-096/abigail/lua/ch-1.lua b/challenge-096/abigail/lua/ch-1.lua
new file mode 100644
index 0000000000..9c4b1de913
--- /dev/null
+++ b/challenge-096/abigail/lua/ch-1.lua
@@ -0,0 +1,14 @@
+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
+ table . insert (words, 1, str)
+ end
+
+ --
+ -- Print the words
+ --
+ io . write (table . concat (words, " "), "\n")
+end