当前位置: 首页>>代码示例>>Python>>正文


Python Engine.play方法代码示例

本文整理汇总了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()
开发者ID:deanmac5,项目名称:LPTHW,代码行数:11,代码来源:Game.py

示例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)	
		

开发者ID:briangillespie,项目名称:poker,代码行数:29,代码来源:main.py


注:本文中的Engine.play方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。