pyblackjack


Namepyblackjack JSON
Version 0.2.0a1 PyPI version JSON
download
home_pageNone
SummarySimple terminal-based blackjack game
upload_time2024-12-19 06:53:38
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT license
keywords game blackjack
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyblackjack

**pyblackjack** is a fun way to waste time at the terminal playing
blackjack with a computerized dealer.

## Installation

pyblackjack is [available on PyPI](https://pypi.org/project/pyblackjack/)
as a pre-release version. To install, type the following into the
terminal, assuming that the appropriate `pip` is on your PATH:

`pip install pyblackjack`

## Getting Started

Type `blackjack` at the terminal to launch the game. At the first
prompt, you may press `q` to jump straight into the action, using a
default player name, six-deck shoe, and 1,000 starting chips, with the
dealer hitting on soft 17.

You can also configure the game to your liking by going through the
prompts. The first prompt asks you for the number of players (human; CPU
players may come in the future but are not available yet). You can
select from one to six players, and enter a name for each. Next, you
will be asked for the number of starting chips per player, followed by
the number of decks in the shoe (up to eight). The last prompt will ask
you if the dealer should hit on a soft 17 (which increases the house
edge slightly). After this, you're ready to start playing!

## Playing

Your first task for every hand is to enter your bet. After all players
have placed a bet, the cards will be dealt and displayed. At this point,
if the dealer is showing an Ace, each player will be asked whether they
wish to buy insurance, the cost of which is one-half of your bet.

After this, or if the dealer is not showing an Ace, blackjacks will be
checked. If the dealer has a blackjack, it will be revealed, the hand
ends immediately, and all players lose unless they also have blackjack,
in which case it is a push. If anyone bought insurance, they will lose
their bet but be paid 2:1 on the insurance.

If the dealer does not have blackjack, but a player does, that player is
paid at 3:2 and takes no further part in the hand.

After this, if any active players remain, the first player in turn order
will be shown their hand and asked for an action. Available actions are
listed below. Except for hit and stand, all actions are only available
as your first action before doing anything else, and then sometimes only
under certain circumstances as noted.

* Hit (`h`): Deal another card to your hand. If this results in a hard
  total over 21, the game will display a message that you busted, and
  your turn will end and you will lose your bet.

* Stand (`s`): End your turn.

* Double down (`d`): Double your bet, deal one (and only one) additional
  card to the hand, and end your turn. This option is only available
  when your first two cards total 9, 10, or 11.

* Split (`p`): Split your two starting cards into two separate hands,
  placing a second bet identical to your original bet on the second
  hand. This is only available if both starting cards form a pair (e.g.
  two sixes or two queens). A second card will then be dealt to each
  hand, which will be played separately from the other. After splitting,
  the only actions available on the split hands will be to hit or stand,
  except that if you split a pair of aces, your turn will end
  immediately after the second card is dealt to each hand (i.e. you
  cannot hit split aces).

* Surrender (`u`): Give up and drop out of the hand, with half your bet
  being returned.

Once the first player has completed their turn, the next player will be
asked for actions, and so on until all players have played. At this
point, the dealer will reveal the downcard and play their hand. The
dealer will hit on 16 or below and stand on 17 or higher, except that if
the option for the dealer to hit on soft 17 was enabled in setup (or the
quickstart option was chosen), the dealer will do so.

Once the dealer has played their hand, the dealer pays the winners. If
the dealer busts, all players who did not also bust are paid 1:1. If the
dealer did not bust, players with a higher total than the dealer are
paid 1:1, players with the same total push (receive their bet back), and
players with a lower total lose their bet.

The game will then return to the prompt to enter a bet. At this prompt,
any player wishing to quit may enter `q` to do so and will be removed
from the game. If the last player in the game quits, the program will
terminate.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyblackjack",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "game, blackjack",
    "author": null,
    "author_email": "Jonathan Goble <jcgoble3@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ac/6c/7031ce5d1c84c41d04c752859f86a4fa03efe149b922aee9435980825088/pyblackjack-0.2.0a1.tar.gz",
    "platform": null,
    "description": "# pyblackjack\n\n**pyblackjack** is a fun way to waste time at the terminal playing\nblackjack with a computerized dealer.\n\n## Installation\n\npyblackjack is [available on PyPI](https://pypi.org/project/pyblackjack/)\nas a pre-release version. To install, type the following into the\nterminal, assuming that the appropriate `pip` is on your PATH:\n\n`pip install pyblackjack`\n\n## Getting Started\n\nType `blackjack` at the terminal to launch the game. At the first\nprompt, you may press `q` to jump straight into the action, using a\ndefault player name, six-deck shoe, and 1,000 starting chips, with the\ndealer hitting on soft 17.\n\nYou can also configure the game to your liking by going through the\nprompts. The first prompt asks you for the number of players (human; CPU\nplayers may come in the future but are not available yet). You can\nselect from one to six players, and enter a name for each. Next, you\nwill be asked for the number of starting chips per player, followed by\nthe number of decks in the shoe (up to eight). The last prompt will ask\nyou if the dealer should hit on a soft 17 (which increases the house\nedge slightly). After this, you're ready to start playing!\n\n## Playing\n\nYour first task for every hand is to enter your bet. After all players\nhave placed a bet, the cards will be dealt and displayed. At this point,\nif the dealer is showing an Ace, each player will be asked whether they\nwish to buy insurance, the cost of which is one-half of your bet.\n\nAfter this, or if the dealer is not showing an Ace, blackjacks will be\nchecked. If the dealer has a blackjack, it will be revealed, the hand\nends immediately, and all players lose unless they also have blackjack,\nin which case it is a push. If anyone bought insurance, they will lose\ntheir bet but be paid 2:1 on the insurance.\n\nIf the dealer does not have blackjack, but a player does, that player is\npaid at 3:2 and takes no further part in the hand.\n\nAfter this, if any active players remain, the first player in turn order\nwill be shown their hand and asked for an action. Available actions are\nlisted below. Except for hit and stand, all actions are only available\nas your first action before doing anything else, and then sometimes only\nunder certain circumstances as noted.\n\n* Hit (`h`): Deal another card to your hand. If this results in a hard\n  total over 21, the game will display a message that you busted, and\n  your turn will end and you will lose your bet.\n\n* Stand (`s`): End your turn.\n\n* Double down (`d`): Double your bet, deal one (and only one) additional\n  card to the hand, and end your turn. This option is only available\n  when your first two cards total 9, 10, or 11.\n\n* Split (`p`): Split your two starting cards into two separate hands,\n  placing a second bet identical to your original bet on the second\n  hand. This is only available if both starting cards form a pair (e.g.\n  two sixes or two queens). A second card will then be dealt to each\n  hand, which will be played separately from the other. After splitting,\n  the only actions available on the split hands will be to hit or stand,\n  except that if you split a pair of aces, your turn will end\n  immediately after the second card is dealt to each hand (i.e. you\n  cannot hit split aces).\n\n* Surrender (`u`): Give up and drop out of the hand, with half your bet\n  being returned.\n\nOnce the first player has completed their turn, the next player will be\nasked for actions, and so on until all players have played. At this\npoint, the dealer will reveal the downcard and play their hand. The\ndealer will hit on 16 or below and stand on 17 or higher, except that if\nthe option for the dealer to hit on soft 17 was enabled in setup (or the\nquickstart option was chosen), the dealer will do so.\n\nOnce the dealer has played their hand, the dealer pays the winners. If\nthe dealer busts, all players who did not also bust are paid 1:1. If the\ndealer did not bust, players with a higher total than the dealer are\npaid 1:1, players with the same total push (receive their bet back), and\nplayers with a lower total lose their bet.\n\nThe game will then return to the prompt to enter a bet. At this prompt,\nany player wishing to quit may enter `q` to do so and will be removed\nfrom the game. If the last player in the game quits, the program will\nterminate.\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Simple terminal-based blackjack game",
    "version": "0.2.0a1",
    "project_urls": {
        "Home": "https://gitlab.com/jgoble/blackjack"
    },
    "split_keywords": [
        "game",
        " blackjack"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9663b6b5eb25e2675452e3848567dd23f0602003b8be0ddc836231925f6733fa",
                "md5": "e0bf0b461b35e96c120040741b6e6209",
                "sha256": "9320d969b2a16819f8c8da44c334e659a748c131e5a0d1ec2cf57729e055f08d"
            },
            "downloads": -1,
            "filename": "pyblackjack-0.2.0a1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e0bf0b461b35e96c120040741b6e6209",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 9948,
            "upload_time": "2024-12-19T06:53:37",
            "upload_time_iso_8601": "2024-12-19T06:53:37.738430Z",
            "url": "https://files.pythonhosted.org/packages/96/63/b6b5eb25e2675452e3848567dd23f0602003b8be0ddc836231925f6733fa/pyblackjack-0.2.0a1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac6c7031ce5d1c84c41d04c752859f86a4fa03efe149b922aee9435980825088",
                "md5": "9addf77f274ec948a4471830ba88ee4d",
                "sha256": "420466443bb57dba58a04a49aa6cc39533a9231acce858d4d1422588f4da5a26"
            },
            "downloads": -1,
            "filename": "pyblackjack-0.2.0a1.tar.gz",
            "has_sig": false,
            "md5_digest": "9addf77f274ec948a4471830ba88ee4d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 18295,
            "upload_time": "2024-12-19T06:53:38",
            "upload_time_iso_8601": "2024-12-19T06:53:38.716348Z",
            "url": "https://files.pythonhosted.org/packages/ac/6c/7031ce5d1c84c41d04c752859f86a4fa03efe149b922aee9435980825088/pyblackjack-0.2.0a1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-19 06:53:38",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "jgoble",
    "gitlab_project": "blackjack",
    "lcname": "pyblackjack"
}
        
Elapsed time: 0.96685s