diff options
Diffstat (limited to 'the-ideal-stocking-stuffer')
-rw-r--r-- | the-ideal-stocking-stuffer/tiss-test.scm | 1 | ||||
-rw-r--r-- | the-ideal-stocking-stuffer/tiss.scm | 7 |
2 files changed, 4 insertions, 4 deletions
diff --git a/the-ideal-stocking-stuffer/tiss-test.scm b/the-ideal-stocking-stuffer/tiss-test.scm index a85371b..d5d1fac 100644 --- a/the-ideal-stocking-stuffer/tiss-test.scm +++ b/the-ideal-stocking-stuffer/tiss-test.scm @@ -37,4 +37,5 @@ 1048970 (tiss "pqrstuv" "00000" 0)) + (test-end "harness") diff --git a/the-ideal-stocking-stuffer/tiss.scm b/the-ideal-stocking-stuffer/tiss.scm index 5162b40..eeac931 100644 --- a/the-ideal-stocking-stuffer/tiss.scm +++ b/the-ideal-stocking-stuffer/tiss.scm @@ -9,14 +9,13 @@ (define (tiss prefix output-prefix suffix) - "Given KEY puzzle key and the desired + "Given KEY puzzle key, the desired OUTPUT-PREFIX, and the current suffix, incrementally tries hash inputs until the desired output is achieved. -Throws an exception after 150000 iterations." - ;; (display (format #f "suffix is now: ~s\n" suffix)) - (when (> suffix 1000000000) +Throws an exception after 10000000 iterations." + (when (> suffix 10000000) (raise-exception (make-exception-with-message (format #f "Exceeded maximum attempts for key ~s!" prefix)))) |