Skip to content

Commit

Permalink
moved win condition to separate file, more refactorings in preparatio…
Browse files Browse the repository at this point in the history
…n for bots
  • Loading branch information
bitsai committed Sep 17, 2010
1 parent d491ba4 commit e59df23
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions win_fns.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(ns win-fns)

(defn ffa-win-fn [cycles]
(let [live-cycles (filter #(not (nil? %)) cycles)]
(case (count live-cycles)
1 (str (:name (first live-cycles)) " wins!")
0 "Tie!"
nil)))

0 comments on commit e59df23

Please sign in to comment.