From 1440839d153c33ae9216bef959c38affab2d32b0 Mon Sep 17 00:00:00 2001 From: Abigail Date: Thu, 21 Jan 2021 16:48:08 +0100 Subject: Add some standard comments and hash bang lines. --- challenge-096/abigail/lua/ch-1.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) mode change 100644 => 100755 challenge-096/abigail/lua/ch-1.lua (limited to 'challenge-096/abigail/lua/ch-1.lua') diff --git a/challenge-096/abigail/lua/ch-1.lua b/challenge-096/abigail/lua/ch-1.lua old mode 100644 new mode 100755 index 9c4b1de913..7ff3b94814 --- a/challenge-096/abigail/lua/ch-1.lua +++ b/challenge-096/abigail/lua/ch-1.lua @@ -1,3 +1,13 @@ +#!/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. -- cgit From 5c43277e4f2fd1b90d3a51f140f3f4be04e5a06c Mon Sep 17 00:00:00 2001 From: Abigail Date: Thu, 21 Jan 2021 22:20:20 +0100 Subject: Skip any whitespace, not just spaces --- challenge-096/abigail/lua/ch-1.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'challenge-096/abigail/lua/ch-1.lua') diff --git a/challenge-096/abigail/lua/ch-1.lua b/challenge-096/abigail/lua/ch-1.lua index 7ff3b94814..c2de0434f6 100755 --- a/challenge-096/abigail/lua/ch-1.lua +++ b/challenge-096/abigail/lua/ch-1.lua @@ -13,7 +13,7 @@ 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 -- cgit