diff options
Diffstat (limited to 'trebuchet/main.scm')
-rw-r--r-- | trebuchet/main.scm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/trebuchet/main.scm b/trebuchet/main.scm new file mode 100644 index 0000000..f96ba5d --- /dev/null +++ b/trebuchet/main.scm @@ -0,0 +1,17 @@ +;; -*- compile-command: "guile -L . -e main -s main.scm < input.txt"; -*- +(use-modules (t) + ((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 (t (stdin-to-str) + (null? (cdr args)))) + (newline)) |