Add untested day13pt1
[adventofcode2019.git] / src / adventofcode2019 / day13.clj
CommitLineData
15f6c3bb
JK
1(ns adventofcode2019.day13
2 [:require [adventofcode2019.lib :refer :all]
3 [adventofcode2019.intcode :as i]
4 [clojure.string :as str]
5 [clojure.core.match :refer [match]]
6 [clojure.math.combinatorics :as combo]])
7
8(defn day13 []
9 (let [input (i/get-program (input-file))
10 output (:output (i/intcode (i/build-state input)))
11 draw-tiles (fn [screen [x y t]] (assoc screen [x y] t))
12 screen (reduce draw-tiles {} (partition 3 output))]
13 (part1 (count (filter #(= % 4) (vals screen))))
14 #_(part2)))