Pārlūkot izejas kodu

sanity check for advent day count

Vyacheslav Shebanov 5 gadi atpakaļ
vecāks
revīzija
284b5cbe2b
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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)