The main program felt a little dense in sections. It might be useful to create some simple functions like "isHandBusted" in your hand class to simplify the main code.
Here, we'll build a text based Blackjack engine that allows us to play against a dealer, who follows conventional house rules. The logic of blackjack is simple, but.
cool program but it only lets you hit the dealer once. it should let you hit the dealer hey man, wanna check mine version of blackjack using OOP in python.
The main program felt a little dense in sections. It might be useful to create some simple functions like "isHandBusted" in your hand class to simplify the main code.
You got a Blackjack! Embed Embed this gist in your website. I also added the ability to choose number of decks of cards to use, because after 4 or 5 games it would run out of cards and the program would crash, so now you can choose number of cards. You lose. Check the edited version. Sign up for free to join this conversation on GitHub. I'm not sure about score , is it necessary or well implemented enough? You busted. Sorry I am a beginner at python. You Win. You win! The Dealer has Blackjack! Learn more about clone URLs. Works great. I've come up with a version based on this. Thank You. Let's see what the 'net thinks lol. Now works. You signed out in another tab or window.{/INSERTKEYS}{/PARAGRAPH} The dealer got a blackjack. Instantly share code, notes, and snippets. Copy link Quote reply. I added the small feature of displaying your updated hand total after hitting. Have fun. Your score isn't higher than the dealer. The Dealer won. You signed in with another tab or window. Sign in to view. If you get a blackjack, the game just continues. Download ZIP. See you soon Himan10 Here is something you can add. Nicely done!! For me this won't work, Im using V2. Greetings, Emiel. Wilt U zo vriendelijk zijn ze opnieuw in te toetsen? U zult uw inzet terugkrijgen wanneer U nu stopt' self. Your score is higher than the dealer. Hey, i announced problem in total calculation if "A" is coming on hand first or second and you keep hitting which not working well also , it keeps the "A" to be 11 then being 1 and total going up then Thank you. Reload to refresh your session. A bug found on total hand if the hand is [9, "A", 9], the result should be 19 instead of Let's see what the 'net thinks lol blackjack. Player does not lose bet amount. Share Copy sharable link for this gist. As my first python project, I don't think its half bad. Himan10 I had run from command line Just pulled the code down again and ran it.. When the Player is dealt "21" and the dealer "first" card is showing anything other than a 10 or an Ace, it's going to be an automatic BJ for the player. I have updated a few aspects of this program. Uw bankgegevens zijn niet gevonden in onze database. Mogen wij U een aangenaam verstrooiing toewensen' pass elif self. Code Revisions 5 Stars 17 Forks Embed What would you like to do? This comment has been minimized. {PARAGRAPH}{INSERTKEYS}It does work. Skip to content. Here's what I got so far. Nicely done, mjhea0! Sign in to comment. Deck count invalid. Already have an account? Wat is uw bankrekeningnummer? Though I would not hit when I get a [9, "A"], but there is still a logical error in this situation. In the total function, the "else:" in line 36 should indent. Revised code below! Hi Himan10, This is my code. FrancisFan98 hey man, wanna check mine version of blackjack using OOP in python I added both player and dealer hits multiple times with several conditions for both player and dealer about win and loss.