:arrow-macros
:cl-ppcre
:cl-utilities
+ :cl-interpol
:fn
:fiveam)
:pathname "src/"
-; (progn (ql:quickload :fiveam)
-; (ql:quickload :cl-ppcre)
-; (ql:quickload :fn))
(defpackage :adventofcode2020
(:use :cl
:arrow-macros
:split-sequence-if
:split-sequence-if-not)
(:nicknames :aoc2020))
+(in-package :adventofcode2020)
+(named-readtables:defreadtable :adventofcode2020
+ (:merge :standard fn-reader :interpol-syntax))
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(defun tree-collisions (slope tree-map)
(loop with (rise run) = slope
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(defun parse-passport (str-list)
(flet ((parser (str)
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(defun count-answers (join ans-list)
(->> ans-list
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(defun parse-bag-rule (rule)
(cl-ppcre:all-matches-as-strings
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(defun make-program (insts)
(let ((len (length insts))
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(defun make-preambled-list (list k i)
(subseq list (- i k) (1+ i)))
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(defun joltage-distribution (ratings)
(let* ((extended (append '(0) ratings (mapcar λ(+ 3 _) (last ratings)))))
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(defun parse-layout (layout)
(make-array (list (length layout) (length (car layout)))
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(defun parse-action (str)
(cl-ppcre:register-groups-bind
(asdf:load-system :adventofcode2020)
(in-package #:adventofcode2020)
-(named-readtables:in-readtable fn-reader)
+(named-readtables:in-readtable :adventofcode2020)
(day 00 input
(let ((lines (list-from input)))