Quellcode durchsuchen

alert user if there are no open predictions

George C. Privon vor 5 Jahren
Ursprung
Commit
6ddac75a22
1 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen
  1. 4 3
      code/update_predictions.rkt

+ 4 - 3
code/update_predictions.rkt

@@ -146,10 +146,11 @@
   (define uIDs (filter-map (λ (testID)
   (define uIDs (filter-map (λ (testID)
                              (if (member testID resIDs) #f testID))
                              (if (member testID resIDs) #f testID))
                            allIDs))
                            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")
   (displayln "ID(DATE) PREDICTION: LATEST FORECAST")
-  (map printpred-without-score uIDs))
+  (map printpred-without-score uIDs)]))
 
 
 ; print resolved predictions
 ; print resolved predictions
 (define (printres [score #f])
 (define (printres [score #f])