aboutsummaryrefslogtreecommitdiffstats
path: root/AoC2022
diff options
context:
space:
mode:
Diffstat (limited to 'AoC2022')
-rw-r--r--AoC2022/05/makefile4
-rw-r--r--AoC2022/05/solver.el8
2 files changed, 6 insertions, 6 deletions
diff --git a/AoC2022/05/makefile b/AoC2022/05/makefile
index 6516fa4..fce871b 100644
--- a/AoC2022/05/makefile
+++ b/AoC2022/05/makefile
@@ -11,5 +11,5 @@
run:
sbcl --load ~/.sbclrc --script solver.lisp
emacs -batch -l ert -l solver.el -f ert-run-tests-batch-and-exit
- rustc solver.rs && ./solver
- elixir solver.ex
+ # rustc solver.rs && ./solver
+ # elixir solver.ex
diff --git a/AoC2022/05/solver.el b/AoC2022/05/solver.el
index edcd7cc..ed42bb2 100644
--- a/AoC2022/05/solver.el
+++ b/AoC2022/05/solver.el
@@ -23,7 +23,7 @@
(stacks (make-vector stacks-len nil))
next)
(while (setq next (search-backward "]" nil t))
- (push (intern (string (char-before)))
+ (push (char-before)
(aref stacks (/ (- next (line-beginning-position) 1) 4))))
stacks))
@@ -52,12 +52,12 @@
(thread-last
(solver-build-stacks)
(solver-apply-moves execution)
- (seq-map #'car))))
+ (cl-map 'string #'car))))
(ert-deftest solver-solutions ()
- (should (equal '(T P G V Q P F D H)
+ (should (equal "TPGVQPFDH"
(solver #'solver-single-move!)))
- (should (equal '(D M R D F R H H H)
+ (should (equal "DMRDFRHHH"
(solver #'solver-bulk-move!))))