diff options
author | Andinus <andinus@nand.sh> | 2021-02-19 22:59:07 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-02-19 23:08:26 +0530 |
commit | c029e07dd1fea194a674fe9dfee35e3c7a63be06 (patch) | |
tree | 96168e700c70b5d4fe2b70e473fbbfdd9dd07f64 /lib/Octans/CLI.rakumod | |
parent | 151186cad17539451efe7f201c66b689d754ae1a (diff) | |
download | octans-c029e07dd1fea194a674fe9dfee35e3c7a63be06.tar.gz |
Fix the sample puzzle error
It would error out when the user runs sample puzzle because we're using $path.IO.f but that wasn't passed. It prints this error: Invocant of method 'f' must be an object instance of type 'IO::Path', not a type object of type 'IO::Path'.
Diffstat (limited to 'lib/Octans/CLI.rakumod')
-rw-r--r-- | lib/Octans/CLI.rakumod | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Octans/CLI.rakumod b/lib/Octans/CLI.rakumod index 8abfef8..4522571 100644 --- a/lib/Octans/CLI.rakumod +++ b/lib/Octans/CLI.rakumod @@ -44,10 +44,12 @@ multi sub MAIN ( } # Get the puzzle from $path if it's passed. - if $path.IO.f { - @puzzle = $path.IO.lines.map(*.words.cache.Array); - } else { - @puzzle = get-puzzle($path); + with $path { + if $path.IO.f { + @puzzle = $path.IO.lines.map(*.words.cache.Array); + } else { + @puzzle = get-puzzle($path); + } } # set-gray-squares also removes asterisks from @puzzle. |