about summary refs log tree commit diff stats
path: root/lib/Octans
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-03-03 23:58:51 +0530
committerAndinus <andinus@nand.sh>2021-03-03 23:58:51 +0530
commitfba335150a95f7688c2e0ae279e837557d2b5a0e (patch)
tree7c688d9e5ed4f1415b8aaec19f2b32eeed8f1b48 /lib/Octans
parent34dcef166e47d268e98973f609da470c59ed5f07 (diff)
downloadoctans-fba335150a95f7688c2e0ae279e837557d2b5a0e.tar.gz
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.
Diffstat (limited to 'lib/Octans')
-rw-r--r--lib/Octans/CLI.rakumod13
1 files changed, 2 insertions, 11 deletions
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<version>; }