> Not sure I understand what you are doing.
> But, if you have a loop that fits in the
> instruction cache it will run very quickly.
Ok, below is what the highly abbreviated code looks like:
for player hands
for dealer hands
for upcard=minupcard to maxupcard
Calculate StandEV
next upcard
next dealer hands
next player hands
.
The time it takes for each upcard is listed below as well as the sum of all the times and the first column is the time it takes if you just run upcards 1-10 all at once. When running an upcard by itself, e.g. 3 - then minupcard=maxupcard=3. When all at once minupcard=1 and maxupcard=10.
The times are really slow I know, but remember it's VBA and I'm a terrible programmer. I also just truncated the decimals for this post so the sum may be off by a second or two:
All at once Sum Individual
1 2 3 4 5 6 7 8 9 10
Stand time 396 s 123 s 18 s 25 s 21 s 16 s 12 s 9 s 7 s 5 s 4 s 2 s
.
Hopefully that explains it better. But you can see the huge difference in time - from 2 minutes to almost 7 minutes.
Very very weird...
Thanks,
MGP
Bookmarks