diff --git a/aoc.asd b/aoc.asd index 0241340..756197c 100644 --- a/aoc.asd +++ b/aoc.asd @@ -44,6 +44,8 @@ (:file "2024/day13") (:file "2024/day14") (:file "2024/day15") + (:file "2024/day16") + (:file "2024/day17") ))) :description "Advent of Code challenges and solutions." :long-description "Solutions for the AOC challenges." @@ -75,6 +77,8 @@ (:file "2024/day13-test") (:file "2024/day14-test") (:file "2024/day15-test") + (:file "2024/day16-test") + (:file "2024/day17-test") ))) :description "Test system for aoc" :perform (test-op (op c) (symbol-call :parachute :test :aoc/tests))) diff --git a/src/2024/day17.lisp b/src/2024/day17.lisp new file mode 100644 index 0000000..4550dd4 --- /dev/null +++ b/src/2024/day17.lisp @@ -0,0 +1,42 @@ + +(defpackage :aoc/2024/17 + (:use :cl :aoc :alexandria :trivia :lla) + (:export + #:sample-data + #:sample-data2 + #:part1 + #:part2 + )) + +(in-package :aoc/2024/17) + + +(defun parse-line (line) + line) + + +(defun parse-input (lines) + (mapcar #'parse-line lines)) + +(defparameter input-text (test-input 2024 17)) +(defparameter input-data (parse-input input-text)) + +(defparameter sample-text (aoc:split-lines "")) +(defparameter sample-data + (parse-input sample-text)) + +(defun part1 (data) + (length data)) + +(defun part2 (data) + (length data)) + +(defun solve-day () + (format t "part1: ~A~%" (part1 input-data)) + (format t "part2: ~A~%" (part2 input-data))) + +(defun submit () + (let ((p1 (part1 input-data)) + (p2 (part2 input-data))) + (if p1 (submit-part1 2024 17 p1)) + (if p2 (submit-part2 2024 17 p2)))) diff --git a/tests/2024/day17-test.lisp b/tests/2024/day17-test.lisp new file mode 100644 index 0000000..0b427a0 --- /dev/null +++ b/tests/2024/day17-test.lisp @@ -0,0 +1,27 @@ +(defpackage :aoc/2024/17/tests + (:use :cl :aoc :aoc/tests :aoc/2024/tests :parachute :aoc/2024/17)) + +(in-package :aoc/2024/17/tests) + +(define-test suite-2024-17 + ;:parent suite-2024 + ) + +(define-test test-foo + :parent suite-2024-17 + ) + + +(define-test test-bar + :parent suite-2024-17 + ) + + + +(define-test+run test-part1 + :parent suite-2024-17 + (is equal nil (part1 sample-data))) + +(define-test+run test-part2 + :parent suite-2024-17 + (is equal nil (part2 sample-data)))