From c029e07dd1fea194a674fe9dfee35e3c7a63be06 Mon Sep 17 00:00:00 2001 From: Andinus Date: Fri, 19 Feb 2021 22:59:07 +0530 Subject: 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'. --- lib/Octans/CLI.rakumod | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/Octans/CLI.rakumod') 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. -- cgit 1.4.1-2-gfad0