Personnal Project (Computer Sciences): Blackjack

Hi everyone,

I just finished my first personnal project in Python which is a Blackjack simulator.
The objective was to simulate a real online Blackjack casino.

If you have any feebacks to improve the code and / or ideas about additional features. I would be happy to read them!

https://github.com/srocroix/BlackJack-project/blob/main/blackjack-project.py

Features:

  • Allow to play vs a computer.

  • Allow to bet virtual money.

  • Allow to set up a robot. This robot will play as much as you want. (ex: You want the robot to play 2000 games to collect some winrate Data)

  • The robot can use betting strategies as Martingale if you want.

  • Print out game Data at the end of each game.

Notice:

  • The computer really acts as a human dealer. Indeed this one starts by shuffling the shoe, then dealing the cards (one face up for him, one face up for the player, one face down for him and a last one face up for you). Once you have played, he will hit while his hand value is under 17.

  • If you have a BJ, the dealer will just show his full hand and won’t play.

  • If the dealer first card (card face up) is an Ace and he has BJ, you won’t be able to play.

  • The contains 6 decks. All casinos, don’t use 6 decks, it can be less or more. You can easily change the number of decks by changing the value of the “num_of_decks” variable.

  • When the shoe has 60 to 75 cards left, the plastic insert card is reached so the dealer pick a new shoe and shuffle it for the next game.

Additional future features:

  • I plan to add double down and split options.

  • I also may add more betting strategies.

3 Likes

I live this.

I’m new to coding, but I’ve been in the Casino business for almost 20 years and I think an option to have the dealer hit or stand on soft 17 would be a good game option to include - it affects the house edge.

Good stuff, mate. There is a lot of opportunity in the Casino industry for software, and they are only starting to scratch the service with things like AI.

Have a great week.

Cheers!

G

3 Likes

Good idea about the dealer option! I never experienced this kind of table personnally but you’re right, the more options the better! I’ll add this feature in a uptdate.

Thanks a lot for the precious feeback mate!

Have a great weekend!

Cheers!

RS

1 Like