advent-of-code-2023

My solutions to AoC 2023
git clone git://git.entf.net/advent-of-code-2023
Log | Files | Refs

day-10.lisp (1446B)


      1 (defpackage #:aoc-test/day-10
      2   (:use #:cl #:lisp-unit2))
      3 (in-package #:aoc-test/day-10)
      4 
      5 (define-test test-day-10
      6     ()
      7   (multiple-value-bind (task-1)
      8       (aoc:run-day 10 ".....
      9 .S-7.
     10 .|.|.
     11 .L-J.
     12 .....")
     13     (assert= 4 task-1))
     14   (multiple-value-bind (task-1)
     15       (aoc:run-day 10 "..F7.
     16 .FJ|.
     17 SJ.L7
     18 |F--J
     19 LJ...")
     20     (assert= 8 task-1))
     21 
     22   (multiple-value-bind (task-1 task-2)
     23       (aoc:run-day 10 "...........
     24 .S-------7.
     25 .|F-----7|.
     26 .||.....||.
     27 .||.....||.
     28 .|L-7.F-J|.
     29 .|..|.|..|.
     30 .L--J.L--J.
     31 ...........")
     32     (declare (ignore task-1))
     33     (assert= 4 task-2))
     34   (multiple-value-bind (task-1 task-2)
     35       (aoc:run-day 10 "..........
     36 .S------7.
     37 .|F----7|.
     38 .||....||.
     39 .||....||.
     40 .|L-7F-J|.
     41 .|..||..|.
     42 .L--JL--J.
     43 ..........")
     44     (declare (ignore task-1))
     45     (assert= 4 task-2))
     46   (multiple-value-bind (task-1 task-2)
     47       (aoc:run-day 10 ".F----7F7F7F7F-7....
     48 .|F--7||||||||FJ....
     49 .||.FJ||||||||L7....
     50 FJL7L7LJLJ||LJ.L-7..
     51 L--J.L7...LJS7F-7L7.
     52 ....F-J..F7FJ|L7L7L7
     53 ....L7.F7||L7|.L7L7|
     54 .....|FJLJ|FJ|F7|.LJ
     55 ....FJL-7.||.||||...
     56 ....L---J.LJ.LJLJ...")
     57     (declare (ignore task-1))
     58     (assert= 8 task-2))
     59   (multiple-value-bind (task-1 task-2)
     60       (aoc:run-day 10 "FF7FSF7F7F7F7F7F---7
     61 L|LJ||||||||||||F--J
     62 FL-7LJLJ||||||LJL-77
     63 F--JF--7||LJLJ7F7FJ-
     64 L---JF-JLJ.||-FJLJJ7
     65 |F|F-JF---7F7-L7L|7|
     66 |FFJF7L7F-JF7|JL---7
     67 7-L-JL7||F7|L7F-7F7|
     68 L.L7LFJ|||||FJL7||LJ
     69 L7JLJL-JLJLJL--JLJ.L")
     70     (declare (ignore task-1))
     71     (assert= 10 task-2)))