{"id":21257684,"url":"https://github.com/jaime-alv/blackjack","last_synced_at":"2026-06-22T06:31:30.489Z","repository":{"id":131170291,"uuid":"401978936","full_name":"Jaime-alv/Blackjack","owner":"Jaime-alv","description":"A command line blackjack game, with all features from classic blackjack!","archived":false,"fork":false,"pushed_at":"2021-10-29T08:00:08.000Z","size":625,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T06:27:29.237Z","etag":null,"topics":["begginner","blackjack","command-line","multiplayer","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jaime-alv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-01T07:58:10.000Z","updated_at":"2023-03-16T12:34:50.000Z","dependencies_parsed_at":"2023-07-17T21:15:36.423Z","dependency_job_id":null,"html_url":"https://github.com/Jaime-alv/Blackjack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jaime-alv/Blackjack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaime-alv%2FBlackjack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaime-alv%2FBlackjack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaime-alv%2FBlackjack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaime-alv%2FBlackjack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaime-alv","download_url":"https://codeload.github.com/Jaime-alv/Blackjack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaime-alv%2FBlackjack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34637937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["begginner","blackjack","command-line","multiplayer","python"],"created_at":"2024-11-21T04:05:16.237Z","updated_at":"2026-06-22T06:31:30.466Z","avatar_url":"https://github.com/Jaime-alv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blackjack\nA command line blackjack game, with all features from classic blackjack for the whole family!\n\n# The game\nEveryone's favourite! \n\nThe rules are simple, the play is thrilling and you can use all the strategies you want! It doesn't matter if you've never played before\n, or if you are here for a mathematical challenge. This is a game for everyone.\n\nThe most widely played casino banking game in the world, in Blackjack players do not compete against each other. \nThe game is a comparing card game where each player competes against the dealer.\n\nAnd you can play with as many friends as you want!\n\n![cards](img/cards.jpg?raw=true)\n\nPhoto by \u003ca href=\"https://freeimages.com/photographer/vierdrie-46406\"\u003eJean Scheijen\u003c/a\u003e from \u003ca href=\"https://freeimages.com\"\u003eFreeImages\u003c/a\u003e\n# Start up\nTo run the game\n\nClone this repository git clone https://github.com/moebiuszed/Blackjack.git\n\nSetup virtual environment if required python -m venv venv\n\nRun game with python blackjack.py.\n\nDon't need to install anything else other than python.\nGame is built under python 3.9, but it  can possibly run in an older version. \n\n\n# Rules\n\n###### Default and custom mode\n\nYou will be presented with an option to choose, playing with default game rules or your own custom ones. Options are:\n\n- Minimum bet: represents the minimum bet each participant has to make at the start of each game\n- Funds: how much money each player have at available\n- Croupier show card: by default, croupier will show its first card, while second one is revealed when its turns begins.\n\nDefault:\n\n- Minimum bet: 5¢\n- Funds: 100¢\n- Croupier show card\n\n###### Number of players\n\nAfter the rules are set, you'll be asked how many participants will be playing this session. It affects how many packs \nof cards are. Minimum is one, maximum is up to your PC. You don't have to remember which number you are. The script will \nask for your name and everytime it's your turn, it will use said name.\n\n###### The Pack\n\nThe standard 52-card deck is used and, depending on the number of players, several decks could be shuffled together. \nYes, if there is only one deck, there will be only one Ace of Spades, as it should be! The app will remember cards \nbetween games, if all Aces are gone, they're gone until the game reshuffles decks. When there are less than n number of \ncards left, it will be indicated with a prompt and it will be time for the cards to be reshuffled.\n\nOh, and you're free to count cards in here.\n\n###### Object of the game\n\nEach participant attempts to beat the dealer by getting a count as close to 21 as possible, without going over 21.\n\n###### Card values/Scoring\n\nAces can be 1 or 11. Face cards are 10 and any other card is its pip value.\n\n###### Betting\n\nBefore the deal begins, each player places a bet. Minimum bet, by default, is 5¢, and maximum is the player's available \nmoney. There is a hard coded limit of 500¢.\n\n###### The deal\n\nWhen all players have placed their bets, each player receive two cards, croupier too. All cards will be shown except croupier's second one.\n\n![first round](img/first_round.jpg?raw=true)\n\n###### Naturals\n\nIf a player's first two cards are an ace and a \"ten-card\" (a picture card or 10), giving a count of 21 in two cards, \nthis is a natural or \"blackjack.\" If any player has a natural and the dealer does not, the dealer pays that player one \nand a half times the amount of their bet (a 3 to 2 payoff). If the dealer has a natural, they immediately collect the \nbets of all players who do not have naturals, (but no additional amount). If the dealer and another player both have \nnaturals, the bet of that player is a stand-off (a tie), and the player takes back his bet.\n\nIf the dealer's face-up card is a ten-card or an ace, they look at their face-down card to see if the two cards make a natural. If the face-up card is not a ten-card or an ace, they do not look at the face-down card until it is the dealer's turn to play.\n\n###### The play\n\nOrder is static, Player 1 always starts first, and then comes Player 2 and so on. Player must decide whether to \"stand\" (not ask for another card) or \"hit\" (ask for another card in an attempt to get closer to a count of 21, or even hit 21 exactly). Thus, a player may stand on the two cards originally dealt to them, or they may ask the dealer for additional cards, one at a time, until deciding to stand on the total (if it is 21 or under), or goes \"bust\" (if it is over 21). In the latter case, the player loses and the dealer collects the bet wagered. The dealer then asks next player and serves them in the same manner.\n\nThe combination of an ace with a card other than a ten-card is known as a \"soft hand,\" because the player can count the ace as a 1 or 11, and either draw cards or not. For example with a \"soft 17\" (an ace and a 6), the total is 7 or 17. While a count of 17 is a good hand, the player may wish to draw for a higher total. If the draw creates a bust hand by counting the ace as an 11, the player simply counts the ace as a 1 and continues playing by standing or \"hitting\" (asking the dealer for additional cards, one at a time). When the player hit s (for stand), the game will pick the highest value without going over 21. If a participant draws 'Ace of Spades' and 'Eight of Hearts', it will be displayed both values, 9 and 19; if, for example, 'five of Clubs' is drawn next, only 14 will be displayed, as 24 is over 21.\n\n![Ace](img/Ace.jpg?raw=true)\n\n\n###### The Croupier's play\n\nWhen the dealer has served every player, the dealers face-down card is turned up. If the total is 17 or more, it must stand. If the total is 16 or under, they must take a card. The dealer must continue to take cards until the total is 17 or more, at which point the dealer must stand. If the dealer has an ace, and counting it as 11 would bring the total to 17 or more (but not over 21), the dealer must count the ace as 11 and stand. The dealer's decisions, then, are automatic on all plays, whereas the player always has the option of taking one or more cards.\n\n![croupier](img/croupier.jpg?raw=true)\n\n\n###### Splitting pairs\n\nIf a player's first two cards are of the same denomination, such as two jacks or two sixes, they may choose to treat \nthem as two separate hands when their turn comes around. The amount of the original bet then goes on one of the cards, \nand an equal amount must be placed as a bet on the other card. The player first plays the hand #1 by standing or hitting\none or more times; only then is the hand to the #2 played. The two hands are thus treated separately, and the dealer \nsettles with each on its own merits. With a pair of aces, the player is given one card, and only one, for each ace and \ncan not draw again. Also, if a ten-card is dealt to one of these aces, the payoff is equal to the bet (not one and \none-half to one, as with a blackjack at any other time).\n\n###### Doubling down\n\nAnother option open to the player is doubling their bet when the original two cards dealt total 9, 10, or 11. When the \nplayer's turn comes, they place a bet equal to the original bet, and the dealer gives the player just one card. With two \nfives, the player may split a pair, double down, or just play the hand in the regular way. Note that the dealer does not have the option of splitting or doubling down.\n\n###### Insurance \nWhen the dealer's face-up card is an ace, any of the players may make a side bet of up to half the original bet that the\ndealer's face-down card is a ten-card, and thus a blackjack for the house. Once all such side bets are placed, the \ndealer looks at the hole card. If it is a ten-card, it is turned up, and those players who have made the insurance bet \nwin and are paid double the amount of their half-bet - a 2 to 1 payoff. When a blackjack occurs for the dealer, of \ncourse, the hand is over, and the players' main bets are collected - unless a player also has blackjack, in which case \nit is a stand-off. Insurance is invariably not a good proposition for the player, unless they are quite sure that there \nare an unusually high number of ten-cards still left undealt.\n\n###### Settlement\n\nA bet once paid and collected is never returned. Thus, one key advantage to the dealer is that the player goes first. \nIf the player goes bust, they have already lost their wager, even if the dealer goes bust as well. If the dealer goes \nover 21, the dealer pays each player who has stood the amount of that player's bet. If the dealer stands at 21 or less, \nthe dealer pays the bet of any player having a higher total (not exceeding 21) and collects the bet of any player having \na lower total. If there is a stand-off (a player having the same total as the dealer), no ¢ are paid out or collected.\n\n![end](img/end.jpg?raw=true)\n\n\n###### Withdraw\n\nAfter the game resolution, if any participant would want to withdraw, they can do so by typing their name. The script \nwill recognize the player and deactivate its profile for the remainder of the session. If any player's funds are below \nthe minimum bet, they're automatically deactivated and if there are no players left, the script will quit by itself.\n\n![lots of cards](img/ending.jpg?raw=true)\n\nPhoto by \u003ca href=\"https://freeimages.com/photographer/mordoc-41072\"\u003eChristophe Libert\u003c/a\u003e from \u003ca href=\"https://freeimages.com\"\u003eFreeImages\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaime-alv%2Fblackjack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaime-alv%2Fblackjack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaime-alv%2Fblackjack/lists"}