Skip to content

Instantly share code, notes, and snippets.

@mks-m
mks-m / d8.clj
Last active December 27, 2018 14:26
(ns d8)
(defonce d8-input (slurp "d8.txt"))
(defonce d8-input-list (read-string (str "[" d8-input "]")))
(defn read-node [[cn mn & data]]
(let [[ccol rest]
(loop [ccol [] rest data cn cn]
(if (= 0 cn)
[ccol rest]
(let [[node rest] (read-node rest)]