Skip to content

Instantly share code, notes, and snippets.

@geoffrasb
Created January 3, 2012 19:27
Show Gist options
  • Save geoffrasb/1556478 to your computer and use it in GitHub Desktop.
Save geoffrasb/1556478 to your computer and use it in GitHub Desktop.
genpair = (num)->
return [] if num<=1
result = []
for i in [0..num-2]
result = result.concat ([i,n] for n in [i+1..num-1])
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment