Hey guys - I am new to coding and wanted to start making my own projects without as much supervision or direction. I made a Python script that can play blackjack on the user’s computer terminal and posted it to Github (https://github.com/LawlessJ/Blackjack)
It essentially allows the user to: place a bet, hit/stay/double down on their move, and see which cards they are randomly drawn. The dealer doesn’t move if the player busts. The factors for bets are also considered (double down multiplies wins/losses by 2, natural blackjack pays out 3:2, and both together X3).
The card deck is a dictionary of card names (keys) matched to their score in Blackjack (values) with Aces having both a 1 and 11 value. The game is also able to keep track of whether an Ace should be “high” or “low” and can make adjustments during play.
The dealer is automated and does what every casino dealer does - hit until score is at least 17 and then stay.
I’d love if you guys can take a look at the script and let me know how I can make the code cleaner and better functioning. Feel free to run it and try your luck at the game, too! Thanks.