

The criterion I've used for doubling down is that this gives a better expected gain (positive or negative) than the other alternatives, taking into account the doubled stake.

To be reasonably realistic, I decided to anticipate some further strategy tables I've computed for rounds after the initial deal and to assume that further decisions (to hit or stand) will be made in accordance with these tables. The task asks us to calculate precise probabilities for all possible continuations after the player stands, hits, doubles or splits but this is impossible if the player 'hits' or 'splits' as we don't know what decisions (s)he will make subsequently. I then checked the resulting table against a similar one on an 'active' online gambling site (which I'd better not link to here) and the results agreed to 6 decimal places.

The objective of this task is to recreate and explore the following strategy charts for the game of blackjack (which is known by many other names as well).īegin by assuming the player's dealt hand contains no aces and is not a pair.Ĭreate functions which given the players dealt cards and the dealers exposed card returns the number of wins and losses for all possible continuations when the player either sticks or hits. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page. #include Ĭard::Card(int ct, int cn) : cardNum(cn), cardType(ct) Ĭout getHand()->getCards().Blackjack strategy is a draft programming task. Besides, it also has a dealer that takes when his hand is under 17 and stands when it is over. This game features betting, taking a card, standing, and splitting a hand.

I am relatively new to c++ and OOP, so I am asking for feedback on what could be improved.
