Skip to content

Instantly share code, notes, and snippets.

@notionparallax
Created September 5, 2016 13:23
Show Gist options
  • Select an option

  • Save notionparallax/fd467b8fb791810fb2e26def26646586 to your computer and use it in GitHub Desktop.

Select an option

Save notionparallax/fd467b8fb791810fb2e26def26646586 to your computer and use it in GitHub Desktop.
import itertools
import random
colours = ["#e67e22","#f1c40f","#27ae60","#1abc9c","#2980b9","#c0392b"]
places = ["Verandah","Kitchen","Toilet","Shower","Desk","Someone else's desk","Meeting N","Meeting S","Quiet N","Quiet S"]
pairs = itertools.combinations(places, 2)
pairs = list(pairs)
for p in pairs:
rnd = random.randint(0,5)
print p[0]+" -> " + p[1] + " {color:"+colours[rnd]+", weight:"+str(rnd+1)+"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment