prepare day12
This commit is contained in:
parent
eb8c2226f7
commit
ab4267bf46
3 changed files with 71 additions and 0 deletions
2
aoc.asd
2
aoc.asd
|
@ -36,6 +36,7 @@
|
||||||
(:file "2024/day09")
|
(:file "2024/day09")
|
||||||
(:file "2024/day10")
|
(:file "2024/day10")
|
||||||
(:file "2024/day11")
|
(:file "2024/day11")
|
||||||
|
(:file "2024/day12")
|
||||||
)))
|
)))
|
||||||
:description "Advent of Code challenges and solutions."
|
:description "Advent of Code challenges and solutions."
|
||||||
:long-description "Solutions for the AOC challenges."
|
:long-description "Solutions for the AOC challenges."
|
||||||
|
@ -63,6 +64,7 @@
|
||||||
(:file "2024/day09-test")
|
(:file "2024/day09-test")
|
||||||
(:file "2024/day10-test")
|
(:file "2024/day10-test")
|
||||||
(:file "2024/day11-test")
|
(:file "2024/day11-test")
|
||||||
|
(:file "2024/day12-test")
|
||||||
)))
|
)))
|
||||||
:description "Test system for aoc"
|
:description "Test system for aoc"
|
||||||
:perform (test-op (op c) (symbol-call :parachute :test :aoc/tests)))
|
:perform (test-op (op c) (symbol-call :parachute :test :aoc/tests)))
|
||||||
|
|
42
src/2024/day12.lisp
Normal file
42
src/2024/day12.lisp
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
|
||||||
|
(defpackage :aoc/2024/12
|
||||||
|
(:use :cl :aoc :alexandria :trivia :lla)
|
||||||
|
(:export
|
||||||
|
#:sample-data
|
||||||
|
#:sample-data2
|
||||||
|
#:part1
|
||||||
|
#:part2
|
||||||
|
))
|
||||||
|
|
||||||
|
(in-package :aoc/2024/12)
|
||||||
|
|
||||||
|
|
||||||
|
(defun parse-line (line)
|
||||||
|
line)
|
||||||
|
|
||||||
|
|
||||||
|
(defun parse-input (lines)
|
||||||
|
(mapcar #'parse-line lines))
|
||||||
|
|
||||||
|
(defparameter input-text (first (test-input 2024 12)))
|
||||||
|
(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 12 p1))
|
||||||
|
(if p2 (submit-part2 2024 12 p2))))
|
27
tests/2024/day12-test.lisp
Normal file
27
tests/2024/day12-test.lisp
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
(defpackage :aoc/2024/12/tests
|
||||||
|
(:use :cl :aoc :aoc/tests :aoc/2024/tests :parachute :aoc/2024/12))
|
||||||
|
|
||||||
|
(in-package :aoc/2024/12/tests)
|
||||||
|
|
||||||
|
(define-test suite-2024-12
|
||||||
|
;:parent suite-2024
|
||||||
|
)
|
||||||
|
|
||||||
|
(define-test test-foo
|
||||||
|
:parent suite-2024-12
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
(define-test test-bar
|
||||||
|
:parent suite-2024-12
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(define-test+run test-part1
|
||||||
|
:parent suite-2024-12
|
||||||
|
(is equal nil (part1 sample-data)))
|
||||||
|
|
||||||
|
(define-test+run test-part2
|
||||||
|
:parent suite-2024-12
|
||||||
|
(is equal nil (part2 sample-data)))
|
Loading…
Reference in a new issue