advent-of-code-2024

My solutions to AoC 2024
Log | Files | Refs

day-16.lisp (930B)


      1 (defpackage #:aoc-test/day-16
      2   (:use #:cl #:lisp-unit2)
      3   (:import-from #:aoc/day-16))
      4 (in-package #:aoc-test/day-16)
      5 
      6 (define-test test-day-16
      7     ()
      8   (multiple-value-bind (task-1 task-2)
      9       (aoc:run-day 16 "###############
     10 #.......#....E#
     11 #.#.###.#.###.#
     12 #.....#.#...#.#
     13 #.###.#####.#.#
     14 #.#.#.......#.#
     15 #.#.#####.###.#
     16 #...........#.#
     17 ###.#.#####.#.#
     18 #...#.....#.#.#
     19 #.#.#.###.#.#.#
     20 #.....#...#.#.#
     21 #.###.#.#.#.#.#
     22 #S..#.....#...#
     23 ###############")
     24     (assert= 7036 task-1)
     25     (assert= 45 task-2))
     26   (multiple-value-bind (task-1 task-2)
     27       (aoc:run-day 16 "#################
     28 #...#...#...#..E#
     29 #.#.#.#.#.#.#.#.#
     30 #.#.#.#...#...#.#
     31 #.#.#.#.###.#.#.#
     32 #...#.#.#.....#.#
     33 #.#.#.#.#.#####.#
     34 #.#...#.#.#.....#
     35 #.#.#####.#.###.#
     36 #.#.#.......#...#
     37 #.#.###.#####.###
     38 #.#.#...#.....#.#
     39 #.#.#.#####.###.#
     40 #.#.#.........#.#
     41 #.#.#.#########.#
     42 #S#.............#
     43 #################")
     44     (assert= 11048 task-1)
     45     (assert= 64 task-2)))