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


Python Deck.remove方法代码示例

本文整理汇总了Python中cards.Deck.remove方法的典型用法代码示例。如果您正苦于以下问题:Python Deck.remove方法的具体用法?Python Deck.remove怎么用?Python Deck.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cards.Deck的用法示例。


在下文中一共展示了Deck.remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Rules

# 需要导入模块: from cards import Deck [as 别名]
# 或者: from cards.Deck import remove [as 别名]
class Rules(Game):
	"""Rules for the game of 500"""
	def __init__(self):
		super(Rules, self).__init__()
		self.deckStyle = 'French'
		self.deck = Deck(self.deckStyle)
		print self.deck
		self.playerLimit = [4]
		self.gameLimit = 0
		self.roundLimit = 0
		self.handLimit = 0

	def deck(self):
		for cards in [(0,2),(1,2),(2,2),(3,2),(0,3),(1,3),(2,3),(3,3),(0,4),(1,4)]:
			card = Card(self.deckStyle, cards[0], cards[1])
			self.deck.remove(card)

	def dealing(self, players):
		for player in range(self.playerLimit):
			return player
开发者ID:tijptjik,项目名称:ridderspel,代码行数:22,代码来源:fivehundred.py

示例2: Rules

# 需要导入模块: from cards import Deck [as 别名]
# 或者: from cards.Deck import remove [as 别名]
class Rules(Game):
	"""Rules for the game of Oh Hell!"""
	def __init__(self):
		self.deckStyle = 'French'
		self.deck = Deck(self.deckStyle)
		self.playerLimit = [3,4,5,6,7]
		self.handLimit = [11,13,15,17,19,21,23]
		super(Rules, self).__init__()
		self.handCounter = 0
		self.hands = [Hand(n, self.handLimit) for n in range(self.handLimit)]
	
	def limitHands(self):
		i = 1
		while self.playerLimit * i < len(self.deck.cards):
			print i
			i = i + 1
			# pass
		self.handLimit = 'xx'

	def setupDeck(self):
		for cards in [(0,2),(1,2),(2,2),(3,2),(0,3),(1,3),(2,3),(3,3),(0,4),(1,4)]:
			card = Card(self.deckStyle, cards[0], cards[1])
			self.deck.remove(card)

	def deal(self):
		self.setupDeck()
		self.deck.shuffle()
		cards = self.deck.cards
		for player in self.players:
			for n in range(self.hands[self.handCounter].cardLimit):
				player.hand.append(cards.pop())

		for player in self.players:
			print str(player), ':'
			holding = u""
			for card in player.hand:
				holding = holding + card.__unicode__() + '  '
			print holding
		print '\n\n\n'
开发者ID:tijptjik,项目名称:ridderspel,代码行数:41,代码来源:ohhell.py


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