Explorar el Código

sanity check for advent day count

Vyacheslav Shebanov hace 5 años
padre
commit
284b5cbe2b
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      plugins/aoc.lisp

+ 1 - 1
plugins/aoc.lisp

@@ -26,7 +26,7 @@
   (poller-call :aoc ""))
 
 (defun get-advent-days-active ()
-  (- 25 (ceiling (/ (- +advent-time+ (get-universal-time)) 86400))))
+  (max 0 (min 25 (- 25 (ceiling (/ (- +advent-time+ (get-universal-time)) 86400))))))
 
 (defun format-stars(completions)
   (format nil "~{~a~^ ~}" (loop for daynum from 1 to (get-advent-days-active)