1 (ns adventofcode2019.day18-test
2 (:require [clojure.test :refer :all]
3 [adventofcode2019.day18 :refer :all]))
5 (deftest test-build-world
7 :t #{[1 1] [2 1] [4 1] [5 1] [6 1] [7 1]}
8 :k {\a [7 1], \b [1 1]}
10 (build-world ["#########"
15 (is (= 2 (path-between ((build-world ["#########"
19 (is (= 28 (path-between ((build-world ["########################"
20 "#...............@.C.D.f#"
21 "#.######################"
22 "#.......a...c.d.A.e.F.g#"
23 "########################"]) :t)
26 (deftest test-accessible
28 (accessible (build-world ["#########"
33 (is (= 8 (acquire-all-keys (build-world ["#########"
36 (is (= 86 (acquire-all-keys (build-world ["########################"
37 "#f.D.E.e.C.b.A.@.a.B.c.#"
38 "######################.#"
39 "#d.....................#"
40 "########################"]))))
41 (is (= 132 (acquire-all-keys (build-world ["########################"
42 "#...............b.C.D.f#"
43 "#.######################"
44 "#.....@.a.B.c.d.A.e.F.g#"
45 "########################"]))))
46 (is (= 136 (acquire-all-keys (build-world ["#################"
54 "#################"]))))
55 (is (= 81 (acquire-all-keys (build-world ["########################"
56 "#@..............ac.GI.b#"
57 "###d#e#f################"
58 "###A#B#C################"
59 "###g#h#i################"
60 "########################"])))))