Skip to content

Instantly share code, notes, and snippets.

@onesuper
Created June 8, 2014 01:50
Show Gist options
  • Save onesuper/2faf976ffad21a0248e7 to your computer and use it in GitHub Desktop.
Save onesuper/2faf976ffad21a0248e7 to your computer and use it in GitHub Desktop.
import random
class Pool:
def __init__(self, names):
self.names = names
def pick(self):
if len(self.names) == 0:
return
i = random.randint(0, len(self.names)-1)
picked = self.names[i]
del self.names[i]
return picked
pool_Z = Pool(["Wang Tao", "Zhang Haibo"])
pool_A = Pool(["Chen Zhitao", "Cheng Yichao", "Peng Yi", "Ding Yadong"])
pool_B = Pool(["Wang Zhaohui", "Zhang Aimin", "Sun Chuanwei", "Liang Weihao"])
pool_C = Pool(["Gaoxao Chuan", "Fang Guoqin", "Qiu Xiaojie", "TBD"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment