From 48fd41b4a011d04634830c9132cf137d33ad555a Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Mon, 5 Dec 2022 15:08:51 +0100 Subject: cleanups --- AoC2022/05/makefile | 4 ++-- AoC2022/05/solver.el | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'AoC2022') 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!)))) -- cgit v1.2.3