Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. (def groups [[:rus :uru]
  2. [:spa :por :ira]
  3. [:fra :den]
  4. [:cro :nig :arg]
  5. [:bra :swi :ser]
  6. [:mex :ger :swe]
  7. [:eng :bel]
  8. [:jap :sen :col]])
  9.  
  10. (defn cross [[g1 g2]]
  11. (for [x g1 y g2] [x y]))
  12.  
  13. (defn possible-matchups [groups]
  14. (->> groups
  15. (partition 2)
  16. (mapcat cross)))
  17.  
  18. (doseq [matchup (possible-matchups groups)]
  19. (prn matchup))
Add Comment
Please, Sign In to add comment