If you're trying to develop one to use in a casino, what casino would let you? Certainly in Nevada, they are illegal (as are Video Poker hand analyzer apps).
Of course if you're good at programming you could create the decision information dynamically, especially as you're only interested in the decision you're facing rather than everything (except you might need to know the House Edge has drifted in your favour). Splits will possibly be the worst to work out!
I don't play online but can appreciate that with a lot of effort you might find a perfect way to play. However I suspect some online casinos will be able to work you've been 100% correct if you start winning a lot and take a dim view. Also I believe some casinos shuffle after every hand as it's so easy for them to do so.
The basic idea is, for a given dealer's upcard, look at all the hands a player can get. Personally it seems easier to start with those with most cards (i.e. 21 Aces) and work down to zero. For each hand you work out what the dealer can get and hence the EV. Also look at all the hands you could get by drawing. Then you know whether you Hit, Stand or Double.
You consider the effects of peeking when looking at the relative chances of the next cards (e.g. sometimes you know something about the dealer's downcard).
Splitting is more complicated and in throey you cater for the fact that one of the split cards has been removed from the deck.
So that's the logic - simples.
- Threads: 60
- Posts: 4815
1. IMO, BJ calculators for optimized play (and betting) need to be customized for a specific game: rules, number of decks and shoe penetration. The differences between single deck vs 8 decks, S17 vs H17, No peek (ENHC) vs peek, doubling and splitting options, etc. have lots of implications and writing an "optimum play" calculator for all rules, all shoe sizes and all penetrations is a monumental task and make the calculator complicated and unwieldy.
2. Much of the edge from optimal play comes from Insurance and 16vT. A standard "bet size"count does an inefficient job with insurance and is deeply flawed for 16vsT (because it counts the removal of a 6 as increasing the motivation to stand when instead it has a very strong influence in the opposite direction. (Also note that games with the surrender rule greatly reduce the opportunity to gain EV from 16 v T).
A count for bet size variation is often not a good way to capture the EV from the swings in card composition because for many of the other "close-call decisions" it is the relative abundance of, say, 9's or 7's that matter, or the abundance of Aces, or the abundance of 2's and 3's vs 4-9. In fact the so-called "illustrious 18" do not include some hands that are legitimate opportunities for optimized decisions because the Hi-LO/Hi-OPT counts are completely useless for providing guidance.
3. Having said all that, composition-dependent optimized decisions can be significant in single and double deck games but (other than insurance and 16vT) not going to make a significant difference in 6-8 deck games. But like a lot of people, I like to fight for every increment of edge I can get.
4. User interfaces for input and output are always important. There are people in the world who write 'robots' that can recognize objects such as cards on screens and, combined with game-specific code, can play on-line poker or online video games. I know almost nothing about the programming or use/problems of such 'robots' but they might be ideal for minimizing manual data entry for your intended application.
5. Anyone who has written source code for a BJ hand calculator has either invested a lot of their personal time or paid a professional programmer to do so. I believe the WOO site owner (at the time) paid a professional programmer to write the source code that you are requesting.
So please understand that it may be a bit much to expect that someone is going to give you a source code simply because you "really want it."
6. Here are two recent threads on the subject.
If you consider an example, do you double 9 vs 2, then it's no good just looking at the next card. If the next card is a 2 (or 3) you're probably going to hit if you don't double. Similarly doubling 10 vs 9 needs to looks at all ways you get to 16 or 17, and then how the dealer does (which actually is easier since there are fewer cards the dealer might use).
And charliepatrick is correct. You generally need to be able to draw at least 5 cards for the dealer and as many as necessary for the player to discriminate between the options on some close-call hands.
Hello! I desperately need the source code of this calculator ( /games/blackjack/hand-calculator/ ), PHP to be more specific, or only the algorithm written in any other language or only matematical explanation to understand how it works because I can implement it by myself in C++ or something like that. I can only get the ml, .js, .css and the needed images but I can't get the p file. I'm decent at math but these blackjack algorithms are giving me headaches. So I need the source code to make some adjustments and change the numbers of cards dealt, my cards and dealer's upcard in real time easily while I'm playing live blackjack, for example. I would apreciate soo much if you can help me with this, I've registered to this forum especially for this problem. Thanks and have a nice day! :D
link to original post
Hey! I am looking since a couple of weeks for the exactly same file. Did you manage to get it?
By the way, a little bit of automation can be set by using the link call that looks something like:
where each 32 is the number of card x in the deck.