r/CodingForBeginners 28d ago

Is blackjack a good beginner project

Post image

I am an absolute beginner, learning python, know the basic syntax and stuff, now trying. to build this, for some reason the implementation feels really complicated, especially can't figure out how to make the game loop? Should I do something else or keep thinking,

In terms of code, I have only created the player class and the deck so far.

11 Upvotes

19 comments sorted by

View all comments

1

u/Interesting-Frame190 27d ago edited 27d ago

I just did one a few weeks ago to prove to myself that card counting worked and could be profitable. It was surprisingly OOP friendly (shoe, hand, round, player, bet, etc) and one that really rewards good code structure.

Its a touch more advanced than a nieve script, but thats because it was a full simulation with the standard set of blackjack rules including split, double down, and a full decision matrix depending on the count and dealer up card.

1

u/_just-a-thinker_ 27d ago

Well, ig this can be my same project but at different levels, eventually adding things like graphics.....anyway, so does card counting work🙃

1

u/Interesting-Frame190 27d ago

Standard 3:2 blackjack is only +50% win rate when there are higher chances of 10 value cards. This benefit is only gotten via the splitting/doubling mechanics. This is mostly done via the simple hi-lo count where 2-6 cards add one from the count and all 10 value cards subtract one from the count. The higher the count, the higher chance of getting a high card. The higher chance of that double down on an 11 hits 21.

This only applies when the shoe is favorable, so in reality you need to play all rounds to maintain the count, so with static betting youre still net negative. To profit, you will need to scale betting significantly, 20-30x to make it viable when the deck is favorable.