Skip to content

Commit

Permalink
cond to condp
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanmai committed Mar 3, 2012
1 parent 43322da commit ceece93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/kata/bowling.clj
Expand Up @@ -2,8 +2,8 @@

(defn frames [rolls]
(take
(cond
(= 10 (apply + (take 1 rolls))) 3
(= 10 (apply + (take 2 rolls))) 3
:else 2)
(condp #(= 10 (apply + (take %1 %2))) rolls
1 3
2 3
2)
rolls))

0 comments on commit ceece93

Please sign in to comment.