a python package for multiplayer blackjack gameplay
Project description
Blackjack Gameplay
This is a python package for playing multiplayer blackjack. The modules retain state to allow for splits, doubles, surrenders, stay, and hit. Multiple players can play, can a single player can have > 1 hand due to splits. Rules are flexible. By default, decks deplete until a stop card is hit. The module retains count, and manages rewards and possible actions.
Overview
This comes with 3 main modules to work with, but Game wraps the other 2 and generally abstracts away the need to work with them directly.
Example:
game = Game()
game.init_round([1, 1]) # 2 players, 1 unit each.
game.deal_init()
for i, player in enumerate(game.players):
while not player.is_done():
moves = player.get_valid_moves()
# randomly take move, unless split is available.
if "split" in moves:
game.step_player(i, "split")
else:
move = choice(moves)
game.step_player(i, move)
game.step_house(only_reveal_card=True)
while not game.house_done():
game.step_house()
game.get_results()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blackjack_multi-0.1.6.tar.gz
(7.5 kB
view hashes)
Built Distribution
Close
Hashes for blackjack_multi-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54dbb079f58c73120452460740791d6ae89c2ed9736d68cf1b73b3d228cf2840 |
|
MD5 | f851296a026586cac6f65f897aa762c7 |
|
BLAKE2b-256 | 0e131e2a8dbc730426e6061324a44c8084d068adb880f37ef6614f4ce30ece7b |