For exemple, in previous puzzle of the week (The Fastest), I get an error:
Exception in thread “main” clojure.lang.LispReader$ReaderException: java.lang.NumberFormatException: Invalid number: 10:15:46
(read) expects a well-formatted input (according to Clojure standards)
(read-line) should help.
Yep, I tried (read-line) ; it has another issue : it reads the line only if there is an effective ‘\n’ at the end, so the last entry is not read. [Edit] I had a bug, the first (read-line) got the empty string after the previous (read) [/Edit]
I guess having a working stub for all the cases may be a problem with this language, but it’s a pity to see the default program does not pass on some puzzles… not very helpful ^^
Pascal stub has a subroutine that splits a line into tokens.
It’s kind of ugly and redundant in most cases, but it gets the job done.
Something similar might do the trick here.