Skip to content

Instantly share code, notes, and snippets.

@fdaoud
Created October 27, 2011 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fdaoud/1320378 to your computer and use it in GitHub Desktop.
Save fdaoud/1320378 to your computer and use it in GitHub Desktop.
Ball of mud
(let [
rnd (send-command "status" "getPredictionRnd")
latest-rnd (send-command "prediction" "getLatestPredictionRnd" {:pooler_id pooler_id :sheet rnd})
preds (send-command "prediction" "getPredictionsForMatchups" {:pooler_id pooler_id :sheet rnd :rnd latest-rnd})]
(if (or (nil? rnd) (= rnd 0))
{:errors "rnd_is_nil_or_zero"}
(get-matchups
(cond
(seq preds) preds
(= rnd 1) (.query persistence "team_playoffs" {})
true (send-command "result" "getWinners" {:rnd (dec rnd)})))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment