1 (asdf:load-system :adventofcode2020)
2 (in-package #:adventofcode2020)
4 (defun calc-seat (seat-spec)
5 (loop with len = (1- (length seat-spec))
8 summing (if (or (char= c #\R) (char= c #\B))
12 (let* ((lines (list-from input))
16 (part1 (first seat-ids))
17 (part2 (loop for big in seat-ids
18 for small in (cdr seat-ids)
19 when (= small (- big 2))
28 (mapcar #'calc-seat '("FBFBBFFRLR" "BFFFBBFRRR"
29 "FFFBBBFRRR" "BBFFBBFRLL")))))