cdee6ac25195e91f96b280b13491334d389234e7 — T T 7 months ago 93e58c2
Name collision fixed
1 files changed, 5 insertions(+), 5 deletions(-)

M day24.lisp
M day24.lisp => day24.lisp +5 -5
@@ 110,12 110,12 @@ (defun arr-by-tag (tag immune infection)
    (if (eql tag 'immune) immune infection))
  
- (defun game-ended (g)
+ (defun imune-game-ended (g)
    (with-slots (immune infection) g
      (when (= (count-if-not #'null immune) 0)
-       (return-from game-ended 'infection))
+       (return-from imune-game-ended 'infection))
      (when (= (count-if-not #'null infection) 0)
-       (return-from game-ended 'immune))))
+       (return-from imune-game-ended 'immune))))
  
  (defun total-units-in-game (g)
    (+ (apply #'+ (map 'list #'unit-end-score (game-immune g)))


@@ 129,7 129,7 @@ (defun game-many-turns (g)
    (let ((current g)
  	(previous-units (total-units-in-game g)))
-     (loop while (not (game-ended current)) do
+     (loop while (not (imune-game-ended current)) do
  	 (setf current (game-turn current))
  	 (let ((current-units (total-units-in-game current)))
  	   (if (= current-units previous-units)


@@ 138,7 138,7 @@ (with-slots (immune infection) current
        (values (+ (apply #'+ (map 'list #'unit-end-score immune))
  		 (apply #'+ (map 'list #'unit-end-score infection)))
- 	      (game-ended current)))))
+ 	      (imune-game-ended current)))))
  
  (test day24-part1
    (is (= 14854 (game-many-turns (parse-game "day24.input")))))