本文整理汇总了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
示例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'