diff options
| author | Abigail <abigail@abigail.be> | 2021-06-16 18:31:25 +0200 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-06-16 18:31:25 +0200 |
| commit | 364bfed5aee47a1c8de4830878d44103263f6c9b (patch) | |
| tree | 516de30f5ee7c38ac28241017f007af29054329c /challenge-117/abigail/node | |
| parent | 2453a627750ee33ee49bde367979204054e92911 (diff) | |
| download | perlweeklychallenge-club-364bfed5aee47a1c8de4830878d44103263f6c9b.tar.gz perlweeklychallenge-club-364bfed5aee47a1c8de4830878d44103263f6c9b.tar.bz2 perlweeklychallenge-club-364bfed5aee47a1c8de4830878d44103263f6c9b.zip | |
Rename prefix to path
Diffstat (limited to 'challenge-117/abigail/node')
| -rw-r--r-- | challenge-117/abigail/node/ch-2.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/challenge-117/abigail/node/ch-2.js b/challenge-117/abigail/node/ch-2.js index ae6449d9f4..0d6d48e6b7 100644 --- a/challenge-117/abigail/node/ch-2.js +++ b/challenge-117/abigail/node/ch-2.js @@ -8,17 +8,17 @@ // Run as: node ch-2.js < input-file // -function steps (x, y, prefix) { +function steps (x, y, path) { if (x == 0 && y == 0) { - console . log (prefix) + console . log (path) return } if (x > 0) { - steps (x - 1, y, prefix + "R") - steps (x - 1, y + 1, prefix + "L") + steps (x - 1, y, path + "R") + steps (x - 1, y + 1, path + "L") } if (y > 0) { - steps (x, y - 1, prefix + "H") + steps (x, y - 1, path + "H") } } |
