So, if you're a software developer who can understand C# and knows blackjack and very basic card counting concepts, please let me know!
Thanks.
Quote: kw2107I wrote a fairly simple blackjack strategy simulator (~500 lines of C#) for my own personal use and I'm looking for another software developer to review it and make sure there's nothing I'm missing. My simulated house edge calculations don't match up with what I see for the rule and strategies I'm using and I can't figure out why.
So, if you're a software developer who can understand C# and knows blackjack and very basic card counting concepts, please let me know!
Thanks.
Can you offer anything in return?
Quote: kw2107I wrote a fairly simple blackjack strategy simulator (~500 lines of C#) for my own personal use and I'm looking for another software developer to review it and make sure there's nothing I'm missing. My simulated house edge calculations don't match up with what I see for the rule and strategies I'm using and I can't figure out why.
So, if you're a software developer who can understand C# and knows blackjack and very basic card counting concepts, please let me know!
Thanks.
I don't mind taking a look. I've done the same thing for several games and these errors can be a pain to track down.
However, before I look at it:
Do you have the dealer "checking for blackjack" correct? In other words, the dealer checks for blackjack before you play out your hand, and you don't play out your hand if he has blackjack.
Do you have the dealer not playing out the hand when you have busted or have BJ on all your hands?
Are you using a cut card? If you are, are you looking at the house edge numbers for that game including the cut card effect? The cut card effect is SIGNIFICANT for single deck.
Are you sure you are looking at the house edge for the right strategy that you are using (total-dependent vs composition dependent?) Again, this is significant for single-deck.
The first time that I did this for single deck, I had a strange bug with the way that split aces were handled (it was really stupid). It changed my simulated edge by 0.2%. Not insignificant!
Yes I think have the dealer blackjack coded correctly. Yep I have a check for the dealer needing to play out the hand. Although, does the down-card get revealed if the dealer doesn't need to play? That would affect counting I would image...
No I'm not using a cut card, but I'm using 6-8 decks typically. Does it matter as much then?
Just a while ago I discovered a stupid bug where I was allowing hitting after splitting aces... That was a pretty significant change as well.
One odd thing I'm doing though is working out all of the "Split" decisions before playing out any of the hands for that player. Not sure if that matters though. The other odd/lazy thing I'm doing is using the average of 2.71 cards per player to burn through the other players at the table.
For my rules (Dealer hits soft 17, 8 decks, split 4 times, late surrender, double after split) and my counting strategy (Hi-Lo, but only to increase wager, not using it to change decision table) I'm getting about a 0.19% advantage for the player. If I disable the counting (by always betting 1 unit) the house edge is about -0.559% which is pretty accurate I think.
Quote: kw2107Thanks for your reply.
Yes I think have the dealer blackjack coded correctly. Yep I have a check for the dealer needing to play out the hand. Although, does the down-card get revealed if the dealer doesn't need to play? That would affect counting I would image...
No I'm not using a cut card, but I'm using 6-8 decks typically. Does it matter as much then?
If you are not using a cut card, how do you decide when to end the shoe?
Quote:Just a while ago I discovered a stupid bug where I was allowing hitting after splitting aces... That was a pretty significant change as well.
One odd thing I'm doing though is working out all of the "Split" decisions before playing out any of the hands for that player. Not sure if that matters though. The other odd/lazy thing I'm doing is using the average of 2.71 cards per player to burn through the other players at the table.
For my rules (Dealer hits soft 17, 8 decks, split 4 times, late surrender, double after split) and my counting strategy (Hi-Lo, but only to increase wager, not using it to change decision table) I'm getting about a 0.19% advantage for the player. If I disable the counting (by always betting 1 unit) the house edge is about -0.559% which is pretty accurate I think.
That is pretty close to the "realistic results" here: https://wizardofodds.com/games/blackjack/calculator/
Why do you think you have a mistake?
Quote: MathExtremistMost analytical calculations are based on the first hand out of a full shoe, however many decks that is. If you're simulating down to a cut card, your numbers will be different. Try putting in a reshuffle after every hand and see if your results match up with your references. Once you get your basic algorithm working, then you start adding features like playing to 75% penetration or count analysis.
Note that the Wizard's "realistic results" on his HE calculator include the cut card effect.
I'll just post my code anyways:
Quote: kw2107Ah yeah I am using a cut card I guess. Not sure what I thought that meant. I'm going through 75% of the shoe. The reason why I thought something was wrong is that I thought you didn't turn the odds in your favor by counting cards unless you started altering your decision tables based on the count.
Particularly in shoe games (4+ decks), most of the advantage gained from counting is from bet variation, NOT play deviations. You cannot beat a standard shoe game without increasing your bets in positive counts, no matter how many indexes you use.
Even a good 2 deck game (good meaning good rules and good pen) requires a bet spread, but indexes are more important here.
Quote: kw2107According the Blackjack Survey, there are a couple of 2 Deck, DAS, No surrender tables Downtown. Using my code, I'm getting a 1.922% player advantage. I guess I know where I'm headed to on my next trip.
You mean, off the top, or with counting?
If you mean off the top, your code is wrong.
If you mean with counting, how wide of a bet spread are you using, and what strategy deviations are you using?
2D S17 DOA DAS noRSA noSurr is a good game. They have it on the strip too (it's my usual game)
(Count = Bet)
< 2 = 1
2 = 2
3 = 4
4 = 8
5 = 10
6 = 12
My original simulation was off because I was dinking around with not betting if the true count is less than -1. I also forgot to modify the tables based on 2 deck though. I ran it again and got a player advantage of about .47%
Any idea what the average penetration in a 2 deck game is?
Quote: kw2107One odd thing I'm doing though is working out all of the "Split" decisions before playing out any of the hands for that player. Not sure if that matters though.
Recently I wrote some software that should simulate playing blackjack against the One2Six shuffler and did the exact same lazy thing. Pffff.
I will have to correct this and see how much of a difference it makes.