I'm try to program a blackjack strategy which makes use of a predetermined chart of moves given the dealer's upcard and the user's hand total. The version I'm implementing only allows hitting and standing — no doubling down, splitting, or surrendering. Furthermore I'm forcing the dealer to keep hitting until his total is greater than or equal to 17 — so no soft-17 rule. I've looked all over and haven't been able to find a chart that meets these specifications — could anybody help me get one? Thanks.
You shouldn't have much trouble at all finding a chart..
What you are looking for is known as Basic Strategy
Replace any double/split with a hit, surrender with fold if your simulation does not allow it.
Edit: As Hymie pointed out in the comments, splits are not always a hit.. in fact many splits you would stand on. A close approximation would be to use the same rules as if pairs (6,6 8,8 etc) were just treated as though they were their totals (12, 16 in those examples).
Generally speaking, if the dealer card is 7 or better, you draw to 17, otherwise you draw until 12 and stand otherwise (with some exceptions, notably 12 vs dealer 2,3)
Not sure if you allow soft-totals for the player..
Why not make the software self learning?
There are several strategies. Code them all (preferably parameterized).
Now start a sequence of simulations and compare the results for each strategy. You can then drop the worst and add adaptations of the winners. Then continue. Until you are satisfied by the result.
For the final product, use some of the winning strategies with a probability similar to the result. This way you eliminate the predictability of the strategy.
All the basic strategy charts I've seen have three sections: one for hard hands, one for soft hands, and one for pair hands. In addition, they contain five strategies:
- double or else hit,
- double or else stand,
Simply ignore the chart for pairs and treat, say, a pair of 8s as a 16. (Steve Oakes' answer calls this "a close approximation," but it's actually exactly correct for a large shoe.) Then treat "double or else hit" as "hit," and "double or else stand" as "stand."
The way to calculate this is to simply take the remaining cards (the ones the dealer isn't showing and aren't in your hand), and calculate the expected for hitting and standing for each card. You should start with highest total (i.e. where your cards add up to 20), then for lower totals, calculate the outcome in terms of those higher ones. The expected value of holding a particular total is the higher of the expected value of hitting and the expected value of standing.
For instance, if you're trying to decide whether to hit on 17, you'll want to know what the expected value of getting to 18, 19, and 20 are to calculate the expected value of hitting and standing.
Expected value of hitting on 17 = (expected value of 18) * (number of aces out) + (expected value of 19) * (number of twos out) + (expected value of 20) * (number of threes out) + (expected value of 21) * (number of fours out)
You will also have to deal with hard and soft totals.