本文整理汇总了Python中Card.shuffleDeckofCards方法的典型用法代码示例。如果您正苦于以下问题:Python Card.shuffleDeckofCards方法的具体用法?Python Card.shuffleDeckofCards怎么用?Python Card.shuffleDeckofCards使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card.shuffleDeckofCards方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: while
# 需要导入模块: import Card [as 别名]
# 或者: from Card import shuffleDeckofCards [as 别名]
import EnumsCards
# 0: Player, 1: KI
numberOf = []
startPlayer = 0
numberOf.append(int(input("How many players? ")))
numberOf.append(int(input("How many computers? ")))
# direction 1: clockwise, -1: counter-clockwise
pointsOfPlayers = Card.initPointsOfPlayers(numberOf[0] + numberOf[1])
# drawCards[1] 0=> + Cards not drawn, 1=> are drawn
drawCards = [0, 0]
names = Card.getNames(numberOf[0])
names.extend(Card.getKINames(numberOf[1]))
while(Card.someHasEnoughtPoints(pointsOfPlayers) == -1):
cardStack = Card.initStackOfCards()
Card.shuffleDeckofCards(cardStack)
handsOfCards = []
for player in range((numberOf[0] + numberOf[1])):
handsOfCards.append(Card.initHand(cardStack))
direction = 1
otherColor = -1
lastCard = Card.drawCard(cardStack)
whichPlayer = startPlayer % (numberOf[0]+numberOf[1])
startPlayer += 1
if lastCard.getValue() == "draw2":
if lastCard.backInDeck == 1:
drawCards[0] = 0
else:
drawCards[0] += 2
elif lastCard.getValue() == "draw4":
if lastCard.backInDeck == 1: