diff options
Diffstat (limited to 'challenge-117/abigail/lua/ch-2.lua')
| -rw-r--r-- | challenge-117/abigail/lua/ch-2.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/challenge-117/abigail/lua/ch-2.lua b/challenge-117/abigail/lua/ch-2.lua index 3e47c2aa9b..bfe11d74d3 100644 --- a/challenge-117/abigail/lua/ch-2.lua +++ b/challenge-117/abigail/lua/ch-2.lua @@ -8,17 +8,17 @@ -- Run as: lua ch-2.lua < input-file -- -function steps (x, y, prefix) +function steps (x, y, path) if x == 0 and y == 0 - then print (prefix) + then print (path) return end if x > 0 - then steps (x - 1, y, prefix .. "R") - steps (x - 1, y + 1, prefix .. "L") + then steps (x - 1, y, path .. "R") + steps (x - 1, y + 1, path .. "L") end if y > 0 - then steps (x, y - 1, prefix .. "H") + then steps (x, y - 1, path .. "H") end end |
