advent-of-code-2023

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

day-8.lisp (717B)


      1 (defpackage #:aoc-test/day-8
      2   (:use #:cl #:lisp-unit2))
      3 (in-package #:aoc-test/day-8)
      4 
      5 (define-test test-day-8
      6     ()
      7   (multiple-value-bind (task-1)
      8       (aoc:run-day 8 "RL
      9 
     10 AAA = (BBB, CCC)
     11 BBB = (DDD, EEE)
     12 CCC = (ZZZ, GGG)
     13 DDD = (DDD, DDD)
     14 EEE = (EEE, EEE)
     15 GGG = (GGG, GGG)
     16 ZZZ = (ZZZ, ZZZ)")
     17     (assert= 2 task-1))
     18   (multiple-value-bind (task-1)
     19       (aoc:run-day 8 "LLR
     20 
     21 AAA = (BBB, BBB)
     22 BBB = (AAA, ZZZ)
     23 ZZZ = (ZZZ, ZZZ)")
     24     (assert= 6 task-1))
     25 
     26   (multiple-value-bind (task-1 task-2)
     27       (aoc:run-day 8 "LR
     28 
     29 11A = (11B, XXX)
     30 11B = (XXX, 11Z)
     31 11Z = (11B, XXX)
     32 22A = (22B, XXX)
     33 22B = (22C, 22C)
     34 22C = (22Z, 22Z)
     35 22Z = (22B, 22B)
     36 XXX = (XXX, XXX)")
     37     (declare (ignore task-1))
     38     (assert= 6 task-2)))