本文整理汇总了Python中Deck.Deck.cardNumberList方法的典型用法代码示例。如果您正苦于以下问题:Python Deck.cardNumberList方法的具体用法?Python Deck.cardNumberList怎么用?Python Deck.cardNumberList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deck.Deck
的用法示例。
在下文中一共展示了Deck.cardNumberList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Deck import Deck [as 别名]
# 或者: from Deck.Deck import cardNumberList [as 别名]
#.........这里部分代码省略.........
#~ print "-------------------",i
#~ print "------jjjjj--------",j
noaction = ""
finalPlayerAction = noaction
if (BlackJack.sumCards(self, playerCards[i]) >= 21):
if verbose:
print "You cannot ask for a card anymore" # TODO : better text here
keepAsking = False
else:
questionText = ""
if verbose:
splitString = ""
print BlackJack.displayPlayerCards(self, playerCards, i)
if(self.splitIsValid(playerCards[i], playersSplit2[i])):
splitString = "to split (P),"
if(BlackJack.doubleIsValid(self, playerCards[i])):
stringInput = ", do you want "+splitString+" to hit (H), to stay (S) or to double (D) ? "
else:
stringInput = ", do you want "+splitString+" to hit (H) or to stay (S) ? "
questionText = self.players[i].getName() + stringInput
#~ playerAction = raw_input(self.players[i].getName() + stringInput)
playerAction = self.strategyList[i].getInput(questionText, "ACTION",
self.deck.cardNumber(dealerCards[0]), self.deck.cardNumberList(playerCards[i]), BlackJack.sumCards(self, playerCards[i]),
BlackJack.doubleIsValid(self, playerCards[i]), self.splitIsValid(playerCards[i], playersSplit2[i]))
finalPlayerAction = playerAction
if(playerAction == "H"):
if (BlackJack.sumCards(self, playerCards[i]) >= 21):
if verbose:
print "You cannot ask for a card anymore" # TODO : better text here
keepAsking = False
finalPlayerAction = noaction
else:
playerCards[i].append(self.deck.drawCard())
if verbose:
print BlackJack.displayPlayerCards(self, playerCards, i)
elif(playerAction == "D"):
if(BlackJack.doubleIsValid(self, playerCards[i])):
if verbose:
print "Your bet has been doubled."
bets[i] = 2*bets[i]
playerCards[i].append(self.deck.drawCard())
if verbose:
print BlackJack.displayPlayerCards(self, playerCards, i)
print "You've chose to Double, you cannot ask for a card anymore"
keepAsking = False
else:
finalPlayerAction = noaction
if verbose:
print "You can't double in this situation."
elif(playerAction == "S"):
keepAsking = False
elif(playerAction == "P"):
if(self.splitIsValid(playerCards[i], playersSplit2[i])):