From 03ad9b7eadb02b05e4eb5074d0fdaadf8dc4ee00 Mon Sep 17 00:00:00 2001 From: bd Date: Wed, 26 Jun 2024 18:43:31 -0600 Subject: AoC 2023.2 p1+2 --- cube-conundrum/main.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 cube-conundrum/main.scm (limited to 'cube-conundrum/main.scm') 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)) -- cgit v1.2.3