本文整理汇总了Python中match.Match.run方法的典型用法代码示例。如果您正苦于以下问题:Python Match.run方法的具体用法?Python Match.run怎么用?Python Match.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类match.Match
的用法示例。
在下文中一共展示了Match.run方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from match import Match [as 别名]
# 或者: from match.Match import run [as 别名]
def main():
'''
Main function permits to launch a match of Quarto
It permits also to modify game configuration (mainly players attributes)
'''
hostname = None
if len(argv) == 2:
hostname = argv[1]
configuration = {
'name_player1': 'Mr. R',
'name_player2': 'Mr. N',
'intelligence_player1': Minimax(3),
'intelligence_player2': Minimax(4),
'hostname': hostname
}
choice = None
while choice != "q":
ui.showMenu()
try:
choice = ui.askChoice(("p", "t", "c", "q")).lower()
except EOFError:
choice = "q"
if choice == "p":
match = Match(configuration)
match.run()
elif choice == "t":
try:
tournament = Tournament(configuration)
tournament.run()
except Exception, e:
print e
elif choice == "c":
configuration = change_configuration()