diff options
Diffstat (limited to 'cube-conundrum/main.scm')
-rw-r--r-- | cube-conundrum/main.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cube-conundrum/main.scm b/cube-conundrum/main.scm new file mode 100644 index 0000000..3703427 --- /dev/null +++ b/cube-conundrum/main.scm @@ -0,0 +1,16 @@ +;; -*- compile-command: "guile -L . -e main -s main.scm 12 13 14 < input.txt"; -*- +(use-modules (cc) + ((ice-9 rdelim)) + (ice-9 binary-ports)) + + +(define (stdin-to-str) + (let loop ((result "")) + (let ((line (read-line))) + (if (eof-object? line) + result + (loop (string-append result line "\n")))))) + +(define (main args) + (display (apply cc (cons (stdin-to-str) (map string->number (cdr args))))) + (newline)) |