summaryrefslogtreecommitdiff
path: root/cube-conundrum/main.scm
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2024-06-26 18:43:31 -0600
committerbd <bdunahu@operationnull.com>2024-06-26 18:43:31 -0600
commit03ad9b7eadb02b05e4eb5074d0fdaadf8dc4ee00 (patch)
treef5852fc851af17e6612711bd7d87db924ddc2661 /cube-conundrum/main.scm
parentfd93afc17c30e480e437a28c6d495b521c0e7fb3 (diff)
AoC 2023.2 p1+2
Diffstat (limited to 'cube-conundrum/main.scm')
-rw-r--r--cube-conundrum/main.scm16
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))