From d7cb89c1c8c0f6f8d4c04f6bf6e347cce6125c87 Mon Sep 17 00:00:00 2001 From: Peter Tillemans Date: Tue, 10 Dec 2024 22:21:36 +0100 Subject: [PATCH] start day 11 --- aoc.asd | 2 ++ src/2024/day11.lisp | 42 ++++++++++++++++++++++++++++++++++++++ tests/2024/day11-test.lisp | 27 ++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 src/2024/day11.lisp create mode 100644 tests/2024/day11-test.lisp diff --git a/aoc.asd b/aoc.asd index f1d17ea..19708e8 100644 --- a/aoc.asd +++ b/aoc.asd @@ -35,6 +35,7 @@ (:file "2024/day08") (:file "2024/day09") (:file "2024/day10") + (:file "2024/day11") ))) :description "Advent of Code challenges and solutions." :long-description "Solutions for the AOC challenges." @@ -61,6 +62,7 @@ (:file "2024/day08-test") (:file "2024/day09-test") (:file "2024/day10-test") + (:file "2024/day11-test") ))) :description "Test system for aoc" :perform (test-op (op c) (symbol-call :parachute :test :aoc/tests))) diff --git a/src/2024/day11.lisp b/src/2024/day11.lisp new file mode 100644 index 0000000..f782a3c --- /dev/null +++ b/src/2024/day11.lisp @@ -0,0 +1,42 @@ + +(defpackage :aoc/2024/11 + (:use :cl :aoc :alexandria :trivia :lla) + (:export + #:sample-data + #:sample-data2 + #:part1 + #:part2 + )) + +(in-package :aoc/2024/11) + + +(defun parse-line (line) + line) + + +(defun parse-input (lines) + (mapcar #'parse-line lines)) + +(defparameter input-text (first (test-input 2024 11))) +(defparameter input-data (parse-input input-text)) + +(defparameter sample-text (aoc:split-lines "")) +(defparameter sample-data + (parse-input sample-text)) + +(defun part1 (data) + nil) + +(defun part2 (data) + nil) + +(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 11 p1)) + (if p2 (submit-part2 2024 11 p2)))) diff --git a/tests/2024/day11-test.lisp b/tests/2024/day11-test.lisp new file mode 100644 index 0000000..f7fccf6 --- /dev/null +++ b/tests/2024/day11-test.lisp @@ -0,0 +1,27 @@ +(defpackage :aoc/2024/11/tests + (:use :cl :aoc :aoc/tests :aoc/2024/tests :parachute :aoc/2024/11)) + +(in-package :aoc/2024/11/tests) + +(define-test suite-2024-11 + ;:parent suite-2024 + ) + +(define-test test-foo + :parent suite-2024-11 + ) + + +(define-test test-bar + :parent suite-2024-11 + ) + + + +(define-test+run test-part1 + :parent suite-2024-11 + (is equal nil (part1 sample-data))) + +(define-test+run test-part2 + :parent suite-2024-11 + (is equal nil (part2 sample-data)))