diff options
| author | Abigail <abigail@abigail.be> | 2021-06-13 21:14:34 +0200 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-06-13 21:14:34 +0200 |
| commit | 7e7b2cab61dcef029b71bd066bf6b5e3a71011af (patch) | |
| tree | c59db29ec40c06bef679a896618fc3dbbbe4b977 /challenge-116/abigail/lua | |
| parent | 3fe9fba9c9d2ec298020988b59ddf16dade7285f (diff) | |
| download | perlweeklychallenge-club-7e7b2cab61dcef029b71bd066bf6b5e3a71011af.tar.gz perlweeklychallenge-club-7e7b2cab61dcef029b71bd066bf6b5e3a71011af.tar.bz2 perlweeklychallenge-club-7e7b2cab61dcef029b71bd066bf6b5e3a71011af.zip | |
Rename make_chain to make_sequence
Diffstat (limited to 'challenge-116/abigail/lua')
| -rw-r--r-- | challenge-116/abigail/lua/ch-1.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/challenge-116/abigail/lua/ch-1.lua b/challenge-116/abigail/lua/ch-1.lua index df551a2e46..fadad776fa 100644 --- a/challenge-116/abigail/lua/ch-1.lua +++ b/challenge-116/abigail/lua/ch-1.lua @@ -8,17 +8,17 @@ -- Run as: lua ch-1.lua < input-file -- -function make_chain (string, start) +function make_sequence (string, start) if string == start then return start end if string : find ("^" .. start) then tail = string : sub (#start + 1, -1) - result = make_chain (tail, tostring (tonumber (start) + 1)) + result = make_sequence (tail, tostring (tonumber (start) + 1)) if result ~= nil then return start .. "," .. result end - result = make_chain (tail, tostring (tonumber (start) - 1)) + result = make_sequence (tail, tostring (tonumber (start) - 1)) if result ~= nil then return start .. "," .. result end @@ -29,7 +29,7 @@ end for line in io . lines () do for i = 1, #line do start = line : sub (1, i) - result = make_chain (line, start) + result = make_sequence (line, start) if result ~= nil then print (result) goto end_main |
