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


Python Player.money方法代码示例

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


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

示例1: setup_player_scaffolding

# 需要导入模块: from models import Player [as 别名]
# 或者: from models.Player import money [as 别名]
 def setup_player_scaffolding(self):
     player = Player()
     player.bet = Decimal(1.00)
     player.money = Decimal(1.00)
     player.games_played = 4
     player.wins = 1
     player.win_percentage = 0.0
     return player
开发者ID:ThatClyde,项目名称:Simple_BlackJack,代码行数:10,代码来源:test_models.py

示例2: setup_dealer_tie_scenario

# 需要导入模块: from models import Player [as 别名]
# 或者: from models.Player import money [as 别名]
    def setup_dealer_tie_scenario(self):
        player = Player()
        player.bet = Decimal(1.00)
        player.money = Decimal(1.00)
        
        card1 = Card('Hearts', 'Jack')
        card2 = Card('Hearts', 'King')
        dealer_hand = Hand()
        player_hand = Hand()
        dealer_hand.add_card(card1)
        player_hand.add_card(card2)

        return player, player_hand, dealer_hand
开发者ID:ThatClyde,项目名称:Simple_BlackJack,代码行数:15,代码来源:test_win_conditions.py

示例3: setup_dealer_blackjack

# 需要导入模块: from models import Player [as 别名]
# 或者: from models.Player import money [as 别名]
    def setup_dealer_blackjack(self):
        player = Player()
        player.bet = Decimal(1.00)
        player.money = Decimal(1.00)
        
        card1 = Card('Hearts', 'Jack')
        card2 = Card('Hearts', 'Ace')
        dealer_hand = Hand()
        player_hand = Hand()
        dealer_hand.add_card(card1)
        dealer_hand.add_card(card2)

        return player, player_hand, dealer_hand
开发者ID:ThatClyde,项目名称:Simple_BlackJack,代码行数:15,代码来源:test_blackjack.py

示例4: clearscreen

# 需要导入模块: from models import Player [as 别名]
# 或者: from models.Player import money [as 别名]
from decimal import Decimal
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()
开发者ID:ThatClyde,项目名称:Simple_BlackJack,代码行数:33,代码来源:play.py


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