一时心起,随便写了一个欧冠16强抽签概率计算器,计算各支球队可能抽到的对手和对应的概率,考虑同国回避和同组回避原则。
当然,花的时间少,写的很烂,能用就行,输出直接搞命令行,性能不考虑,直接全排列简单粗暴,也没考虑扩展和复用什么的,程序也很简短……以后再要用的时候直接改就可以了……
# coding = utf-8
'''
Module: uclDrawCal
Created on 2015-12-10
@author: Ring
'''
import itertools
class team:
def __init__(self, teamName="", teamGroup="", teamCountry="", teamRanking="1"):
self.name = teamName
self.group = teamGroup
self.country = teamCountry
self.ranking = teamRanking
def printTeam(self):
print self.name, "-", self.country, "-", self.group+self.ranking
def isDrawCorrect(list1, list2):
for i in range(0,8):
if (list2[i].group