On Mon, Oct 5, 2015 at 1:08 PM, andrea crotti <andrea.crott...@gmail.com> wrote:
> Yes I came up with the same idea in the end, this is the code that does > that. > > (defn list-teams-combo [players] > "List all the possible team combinations" > (let [players-count (count players) > size (/ (combo/count-combinations players 2) 2) > team-size (/ (count players) 2)] > > (for [team1 (take size (combo/combinations players team-size))] > (list team1 (into () (clojure.set/difference (set players) > team1)))))) > > This line is wrong: size (/ (combo/count-combinations players 2) 2) You mean (for even number of players): size (/ (combo/count-combinations players (/ players-count 2)) 2) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.