aboutsummaryrefslogtreecommitdiffstats
path: root/AoC2022/05
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2022-12-05 15:08:51 +0100
committerOscar Najera <hi@oscarnajera.com>2022-12-06 16:47:39 +0100
commit48fd41b4a011d04634830c9132cf137d33ad555a (patch)
tree8687ea1645baa5bff36784262c8900431c532e56 /AoC2022/05
parent1cea1d8aedac5ec797e9415e05395fc73c9f1497 (diff)
downloadscratch-48fd41b4a011d04634830c9132cf137d33ad555a.tar.gz
scratch-48fd41b4a011d04634830c9132cf137d33ad555a.tar.bz2
scratch-48fd41b4a011d04634830c9132cf137d33ad555a.zip
cleanups
Diffstat (limited to 'AoC2022/05')
-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!))))