Przeglądaj źródła

alert user if there are no open predictions

George C. Privon 5 lat temu
rodzic
commit
6ddac75a22
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4 3
      code/update_predictions.rkt

+ 4 - 3
code/update_predictions.rkt

@@ -146,10 +146,11 @@
   (define uIDs (filter-map (λ (testID)
                              (if (member testID resIDs) #f testID))
                            allIDs))
-
-  ; print a header and individual entry information
+  (cond
+    [(eq? (length uIDs) 0) (displayln "No open predictions.") ]
+    [else ; print a header and individual entry information
   (displayln "ID(DATE) PREDICTION: LATEST FORECAST")
-  (map printpred-without-score uIDs))
+  (map printpred-without-score uIDs)]))
 
 ; print resolved predictions
 (define (printres [score #f])