本文整理汇总了Python中models.Player.start_money方法的典型用法代码示例。如果您正苦于以下问题:Python Player.start_money方法的具体用法?Python Player.start_money怎么用?Python Player.start_money使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Player
的用法示例。
在下文中一共展示了Player.start_money方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: clearscreen
# 需要导入模块: from models import Player [as 别名]
# 或者: from models.Player import start_money [as 别名]
from models import Card, Deck, Hand, Player
from utils import clearscreen, get_bet, win_conditions, blackjack_test
# Starting with a nice, clear screen:
clearscreen()
# Getting the player info
player = Player()
player.name = input("What's your name, pardner? ")
money = (
input(
"How much money are you bringing to the table, {}? $".format(
player.name)))
player.money = Decimal(money)
player.start_money = player.money
bet = 0
# Building the Deck with the number of packs of cards specified
while True:
try:
packs = int(
input("How many packs of cards should make up your deck? [1-10] "))
if packs < 0:
raise ValueError()
break
except ValueError:
print("{} is not a valid number of packs. They will throw you out of Vegas for that kinda crap".format(packs))
deck = Deck(packs)
deck.shuffle()