本文整理汇总了Python中Engine.play方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.play方法的具体用法?Python Engine.play怎么用?Python Engine.play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine.play方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Map
# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import play [as 别名]
__author__ = 'dean'
from sys import exit
import Engine
import Map
start = Map('outside')
game = Engine(start)
game.play()
示例2: int
# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import play [as 别名]
#Game continues playing until the user tells it to stop
stopPlaying = False
while not stopPlaying:
#User determines number of computer players to play against
num_players = int(raw_input("How many players do you want to play against?\n> "))
#Cannot deal more cards than are in the deck
if num_players > 9:
print "Too many players! You'll use up the whole deck."
print "Goodbye!"
exit(1)
#Play game
game = Engine(num_players)
print game.play()
#User determines if (s)he wants to continue playing
next = raw_input("Keep playing?(y/n)\n> ")
if 'n' in next:
stopPlaying = True
elif 'y' in next:
stopPlaying = False
else:
print "INVALID RESPONSE. GOODBYE!"
exit(1)