London Colin
Well-Known Member
Sorry
Mango,
If you compare Eric's original with the code I posted in the other thread, you'll see that another of my changes has sneaked in by mistake.
Throughout the original code, there are numerous expressions which index into zero-based arrays, such as:
hitHand.valueStand[split][upCard - 1];
To tidy things up, and potentially speed things up a little too, I changed all of these so that they are indexed directly, like this:
hitHand.valueStand[split][upCard];
So you have ended up with a hybrid, accessing the wrong array members. Presumably the results were garbage.
Your best approach is probably just to take the original amendments form Eric's bjmath post.
London Colin said:Not sure why that should be. There are only the two fragments I posted.
Admittedly the version I ran also inlcuded lots of my other changes, but these should not have any bearing on the split result.
(If you copied all of the code I posted, including the NEW_SPLIT macro mechanism for choosing between the old and new code, the only other issue would be to make sure you #define the macro, either at the top of the module or in the compilation command line.)
Aha! All becomes clear.London Colin said:Thanks to nightspirit, pointing out that we can still get at the bjmath forum posts via Google, I've got a chance to review some of the discussions that I saw on there years ago.
I should make it clear that among them was one from Eric, supplying the alternative split code which I incorporated. It's his fix, not mine -
http://www.bjmath.com/bin-cgi/bjmath.pl?read=5295 (Archive copy)
Although I've made lots of other changes, I believe it's only the above that affects the way that splits are calculated.
Mango,
If you compare Eric's original with the code I posted in the other thread, you'll see that another of my changes has sneaked in by mistake.
Throughout the original code, there are numerous expressions which index into zero-based arrays, such as:
hitHand.valueStand[split][upCard - 1];
To tidy things up, and potentially speed things up a little too, I changed all of these so that they are indexed directly, like this:
hitHand.valueStand[split][upCard];
So you have ended up with a hybrid, accessing the wrong array members. Presumably the results were garbage.
Your best approach is probably just to take the original amendments form Eric's bjmath post.