From fba335150a95f7688c2e0ae279e837557d2b5a0e Mon Sep 17 00:00:00 2001 From: Andinus Date: Wed, 3 Mar 2021 23:58:51 +0530 Subject: Don't print time taken It was misleading because the time printed was not the time taken to find that specific word, it was the time taken to find all the words upto that word. It would reset for each starting position. It's better to just remove the whole thing. --- lib/Octans/CLI.rakumod | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'lib/Octans/CLI.rakumod') diff --git a/lib/Octans/CLI.rakumod b/lib/Octans/CLI.rakumod index 0719dcd..0672761 100644 --- a/lib/Octans/CLI.rakumod +++ b/lib/Octans/CLI.rakumod @@ -33,8 +33,6 @@ multi sub MAIN( # start-pos block loops over each starting position. start-pos: for $puzzle.gray-squares -> $pos { - my DateTime $initial = DateTime.now; - # gather all the words that word-search finds starting from # $pos. word: for gather word-search( @@ -45,14 +43,8 @@ multi sub MAIN( # word was found. $word, @visited ) { - # If not $verbose then just print the word. - unless so $verbose { - say $word; - next word; - } - - # Print the word, along with the time taken. - printf "\n%s \[%.8f𝑠\]\n", $word, DateTime.now - $initial; + printf "%s$word\n", $verbose ?? "\n" !! ""; + next word unless so $verbose; # Print the puzzle, highlighting the path. for ^$puzzle.grids.elems -> $y { @@ -67,7 +59,6 @@ multi sub MAIN( } } - multi sub MAIN( Bool :$version #= print version ) { say "Octans v" ~ $?DISTRIBUTION.meta; } -- cgit 1.4.1-2-gfad0