src/2016/days/day-03.lisp @ 2848a4548adf
2023/01 and 2022/01 Also start porting my test data to the new account, since Twitter imploded and apparently it's impossible for a website to store a goddamn username and password in The Year of Our Lord 2023 so everyone just outsources auth all the time, ugh.
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Fri, 01 Dec 2023 11:05:43 -0500 |
| parents | 182bdd87fd9e |
| children | (none) |
(advent:defpackage* :advent/2016/03) (in-package :advent/2016/03) (defun validp (a b c) (when (> a b) (rotatef a b)) (when (> b c) (rotatef b c)) (< c (+ a b))) (define-problem (2016 3) (data read-lines-of-numbers-and-garbage) (1032 1838) (values (iterate (for (a b c) :in data) (counting (validp a b c))) (iterate ;; this is just dumb (for (x y z) :on data :by #'cdddr) (for (ax bx cx) = x) (for (ay by cy) = y) (for (az bz cz) = z) (counting (validp ax ay az)) (counting (validp bx by bz)) (counting (validp cx cy cz))))) #; Scratch --------------------------------------------------------------------