コード例 #1
0
ファイル: game.py プロジェクト: DESPEL/programacion-python
    def _create_players(self):
        self.dealer = Dealer()

        name = input("Ingrese su nombre: ")
        money = typed_input(int, "Ingrese la cantidad de dinero que tiene: ",
                            f"{Fore.RED}Error: Ingrese una cantidad válida")
        self.player = Player(name, money)
コード例 #2
0
ファイル: game.py プロジェクト: House-Rulez/black-jack
    def __init__(self,
                 print_func=print,
                 input_func=input,
                 dealer=None,
                 user=None):
        """
    This is where most of the basic game set up should take place. Namely the creation of the deck as well as the dealer. For now we can also add the player.
    In: None
    Exceptions: None
    Out: None
    """
        # Variables to control both the users starting bank as well as their goal
        self.starting_bank = 100
        self.score_goal = 250

        # Override functions so you can create a wrapper around the program
        self._print = print_func
        self._input = input_func

        # Create a new deck of cards
        self.deck = Deck(deck_count=2)

        # Add the players that the game cares about
        self.dealer = dealer or Dealer()
        self.user = user or User(starting_bank=self.starting_bank)
        self.round = 0
コード例 #3
0
 def create_players(self, number_of_players):
     self.players = []
     if self.human_mode:
         number_of_players = int(
             input('How many players are in the game? '))
         for i in range(number_of_players):
             name = input("Enter player number %d name: " % (i + 1))
             money = int(input("Enter player number %d budget: " % (i + 1)))
             player = RegularPlayer(name, money)
             player.print_money()
             self.players.append(player)
     else:
         if number_of_players == 1:
             name = "Player"
             money = 100
             player = RegularPlayer(name, money)
             player.print_money()
             self.players.append(player)
         else:
             for i in range(number_of_players):
                 name = "Player" + str(i + 1)
                 money = random.randint(100, 500)
                 player = RegularPlayer(name, money)
                 player.print_money()
                 self.players.append(player)
     self.dealer = Dealer()
コード例 #4
0
ファイル: game.py プロジェクト: ruebenramirez/blackjack
    def __init__(self, shoe):
        self.shoe = shoe
        self.player_one = Player()
        self.dealer = Dealer()

        # used for game stats
        self.player_won = False
        self.winning_hand_value = None
コード例 #5
0
ファイル: game.py プロジェクト: cyrustabatab/ConsoleBlackjack
    def __init__(self, num_decks=4, num_players=1, initial_amount=50):
        self.num_decks = num_decks
        self.deck = Deck(num_decks)

        self.player = Player(initial_amount)

        self.dealer = Dealer()

        self.wins = self.losses = self.draws = 0

        self._play()
コード例 #6
0
ファイル: test_player.py プロジェクト: House-Rulez/black-jack
def test_dealer_instance():
  assert Dealer()
コード例 #7
0
ファイル: test_player.py プロジェクト: House-Rulez/black-jack
def dealer():
    return Dealer()
コード例 #8
0
ファイル: table.py プロジェクト: rhorrace/CS420Project-Poker
 def __init__(self, max_hand=5, phases=2):
   self._max_hand = max_hand
   self._phase = 0
   self._phases = phases
   self._player = Player()
   self._dealer = Dealer()
コード例 #9
0
 def __init__(self):
     player1 = Player("")
     dealer = Dealer("mr.dealer")
     deck = Deck()
コード例 #10
0
	def __init__(self, players = [], shoe_size = 1):
		self.dealer = Dealer("Dealer")
		self.shoe_size = shoe_size
		self.deck = self.new_deck()
		self.players = players
コード例 #11
0
ファイル: game.py プロジェクト: jmoussa/cli_blackjack
from player import Player, Dealer
from utils import (
    get_hands_result,
    declare_winner,
    print_hand,
    construct_optimal_bet,
    expand_chipset,
    compress_chipset,
    decision_generator,
)

pot = {"ones": 0, "fives": 0, "tens": 0, "twentys": 0, "fiftys": 0}

dealer = Dealer()
player1 = Player()

# Start of the Game
while True:
    playing = True
    num_mapping = {
        "ones": 1,
        "fives": 5,
        "tens": 10,
        "twentys": 20,
        "fiftys": 50
    }
    bust = []
    dealer.deal_hands([player1])
    dealer_card = dealer.hand[0]
    # print(f"Dealer hand: {[str(dealer_card.name) + ' of ' + dealer_card.suit]}")
    print_hand(dealer)
コード例 #12
0
ファイル: bot.py プロジェクト: anishthite/blackjack
 def __init__(self, startingAmount):
     self.deck = Deck()
     self.player = Player(startingAmount)
     self.dealer = Dealer()
     self.id = uuid.uuid4()
コード例 #13
0
 def __init__(self, player_name):
     self.player = Player(player_name, 1000)
     self.dealer = Dealer("Dealer")
     self.game_on = True
     self.player_cards = []
     self.dealer_cards = []