logic of splits

sagefr0g

Well-Known Member
#21
Canceler said:
It's starting to look that way.

If you happen to forget that aces can't be resplit, and only get one card when they are split :)o:laugh:), you still get 48.
yeah i think it is :rolleyes::eek::confused:

hey Canceler, i finally broke down and used my first variable :) (well actually second i guess if you count that checkfirst while dohinkey, thingamajob.)
Sub consolidatecards()
'
' consolidatecards Macro
' gets rid of zeros & spaces in player & dealer hands
'

'
Dim Check, Counter
Check = True: Counter = 0
Do While Counter < 11
Counter = Counter + 1
If Range("D21").Value = 0 And Range("E21").Value <> "" Then
Range("E21").Select
Selection.Cut
Range("D21").Select
ActiveSheet.Paste
End If......................
Exit Do
Loop
don't ask me why it had to get rid of zero's and spaces, lol, but anyway they were place holders for referance to drawing cards.

what ever i'm still stuck on splits, it'll split consecutive pairs but if the pairs aren't consecutive (ie. the next pair arises from say the third hand) then it's a no go:cry:
oh yeah, and i got it to quit being a CSM.:whip:
then if i ever get that working, i got to get it to do DAS as well.
once all that's done i think the thing will at least play blackjack and record hands sorta thing.
 

Canceler

Well-Known Member
#22
sagefr0g said:
hey Canceler, i finally broke down and used my first variable :)
Congratulations! Variables do come in handy. Sounds like you're still making good progress on your project.

Code:
Sub Macro1()
    Range("E21").Cut
    ActiveSheet.Paste Destination:=Range("D21")
End Sub
Sorry, I couldn't resist!
 

sagefr0g

Well-Known Member
#23
Canceler said:
Congratulations! Variables do come in handy. Sounds like you're still making good progress on your project.

Code:
Sub Macro1()
    Range("E21").Cut
    ActiveSheet.Paste Destination:=Range("D21")
End Sub
Sorry, I couldn't resist!
hey don't be sorry!

quick question would that sort of elegance speed the thing up, even if just a little bit?

lol, before i added a whole bunch of code i time tested the thing, i think i figured it would take three months to run a million rounds, lol.

so really if i ever get these splits & das working and that's a really big if then i'm gonna want to clean up the code and see if the thing can run quicker.
 

Canceler

Well-Known Member
#24
sagefr0g said:
quick question would that sort of elegance speed the thing up, even if just a little bit?
Moving the selection from wherever it was to E21, and then to D21, must take some time. The time saved by not doing that would probably add up over a million rounds.

Another thing I was thinking...

Maybe the cutting and pasting is essential to the way your program works. But if it's not, I would probably do something like this:

Code:
Sub Macro1()
    Range("D21").Value = Range("E21").Value
    Range("E21").Value = ""
End Sub
Cutting something sends it to the Clipboard. Pasting brings it back. IF this way avoids the use of the Clipboard (which it probably does, but I'm not sure of that), then it would be faster.
 

sagefr0g

Well-Known Member
#25
still stuck on this split stuff, not ready to give up yet, lol.

so now i'm set straight about the fact that common multiple deck games such as six deckers allows splitting three times to four hands.

so i'm wondering if the in the image below it looks like i've covered all possible ways the split scenario could be played out if in fact the maximum number of splits allowed did occur.

edit: a little explanation of why the heck i'm trying to figure out these scenarios in the first place.
like i don't know how other simulators go about it, but with my program i'm trying to make it draw cards from a shuffled pack in just the order that they physically end up, according to the rules of play and basic strategy sort of thing.
but the thing is i believe i need to know the order in which these split scenarios can present or how they actually happen so that i can tell the program the proper order to draw the cards from the pack to be dealt, sort of thing.
:rolleyes::whip:
 

Attachments

sagefr0g

Well-Known Member
#27
Canceler said:
I'm willing to comment on the part in blue, but you might not be thrilled with what I have to say. Should I do it anyway?
i can't think of there ever being any time i wouldn't want to hear your thoughts or comments.
will it hurt? lol

is it to do with the program will be so slow and the data so impossible to store and deal with that it won't ever be successful?
that's the biggest problem i see.:)
 

Canceler

Well-Known Member
#28
Not what I was originally going to say, but anyway...

sagefr0g said:
will it hurt?
Nah, I’ll be my usual charming, diplomatic self. :vomit:

sagefr0g said:
is it to do with the program...
It’s more to do with the underlying logic of the way you’re doing this, which I finally may be getting a handle on.

I think most people would do what I described earlier in this thread, which is to mimic the way it happens in real life. Deal the cards, see what they are, determine what play should be made, etc.

But it looks like you’re doing it a little differently. I think you’re looking at the upcoming cards in the shoe, and determining what is going to happen.

Suppose your program sees this series of cards: 4,6,4,4,4,7,5,6,10,9,1

Is it going to know that the dealer had a 6 up, the player split to 3 hands, doubled-down twice, stood once, and lost all three hands?

Or maybe the program will look at that series to determine what card goes in which cell, and you evaluate what happened after that?

Just what are you doing?
 

sagefr0g

Well-Known Member
#29
Canceler said:
Nah, I’ll be my usual charming, diplomatic self. :vomit:


It’s more to do with the underlying logic of the way you’re doing this, which I finally may be getting a handle on.

I think most people would do what I described earlier in this thread, which is to mimic the way it happens in real life. Deal the cards, see what they are, determine what play should be made, etc.

But it looks like you’re doing it a little differently. I think you’re looking at the upcoming cards in the shoe, and determining what is going to happen.

Suppose your program sees this series of cards: 4,6,4,4,4,7,5,6,10,9,1

Is it going to know that the dealer had a 6 up, the player split to 3 hands, doubled-down twice, stood once, and lost all three hands?

Or maybe the program will look at that series to determine what card goes in which cell, and you evaluate what happened after that?

Just what are you doing?
so far this don't hurt too bad, lol, :)
it'll show the dealer 6 up and the 4 he is gonna have, it'll show in a case like this the 4's being split. at this point it won't do the das, but it will hit and stand correctly or bust out properly. uhmm, lol i do have a problem though if say the first hand busted and the rest didn't well, lol my program thinks at that point the dealer doesn't have to hit anymore.
but ok, like i'm waiting on trying to fix that sort of stuff cause here is the problem,
say i the situation was 4,6,4,4,10,4,5,6,10,9,1
so it should what, you'd have a dealer 6,4 against the player 4,4 which the program would split and then it would hit the first hand and you'd have player hand one 4,10 and it would stand but then instead when the second hand gets another 4 giving the second hand 4,4 well the program wont split that hand, it'll hit it out improperly in that case.
edit: so it can handle one scenario correctly but the others it's a no go, sort of thing, that's why i'm interested in all the possible scenarios.

like below images sort of similar to your first case scenario shows how the program flows sort of thing at this point.
sorry lol, i had to put your record data part of the images sideways to work with this screen capture and the limitations of the site image size.:(:whip:
oh, and images6 & 7 are missing that would show more fully the eights being dealt with cause the darn program was to fast for me to capture that action, lmao, it's to darn slow to be any good and to fast to see in action.:cry:
edit: oh and in case your wondering about 10's showing up where J or K should be sort of thing those 10's are just the jacks and kings values having been converted, sort of thing. oh, and all those zeros are just place holders sort of thing, that i think i can clean up later as well, lol
 

Attachments

Canceler

Well-Known Member
#30
Even at 400% magnification, and with my reading glasses on, I'm still having trouble seeing what's going on here. And I actually have another project going right now, so it might be a few days before I get back to looking at this, okay?
 

sagefr0g

Well-Known Member
#31
Canceler said:
Even at 400% magnification, and with my reading glasses on, I'm still having trouble seeing what's going on here. And I actually have another project going right now, so it might be a few days before I get back to looking at this, okay?
lol, yeah it's hard to see and even if you did maybe it would still be confusing.
but time no problemo my friend, patience is the one thing in the world i think i know that yields value, just haven't learned to master it yet, lol.

maybe a little further explanation on what's happening in those images would help clarify how the program works.

image1 is pre-deal and post shuffle
immediate cards to be dealt are 858J88KK3Q838

image2 the initial cards are dealt
dealer 5,J vs player 8,8

image3 the player splits the eights and draws one card, now ending up with
dealer 5,J vs 8,8 again and vs the lone 8 of the second hand created by the split

image4 shows that new set of pairs in image3 is now split and another card drawn resulting in three hands 5,J vs 8,8 again & two other partial hands each containing an 8.

image5 shows the third and final split of the eights and another card drawn to the first hand resulting in now
dealer 5,10 vs 8, K (denoted by 10) and three other partial hands each containing an 8.

now it get's 'hairy' cause the program went to quick to capture fully the second and third hand being played out,
essentially what went on there was the 8,k hand stood and was removed and recorded then the next hand had a card drawn to it ending up as 8,K so that hand stood and was removed and recorded.

image8 shows
then a 3 was drawn to the third hand created by the splits and then a Q was drawn giving us the happy twenty one against the dealer 5,J which was removed and recorded leaving one final partial hand of which consisted of an 8.

image9 shows
the final partial hand consisting of an 8 receives another 8.
so now splitting isn't allowed further so the program just stands on that hand.

image10 would show (if you could see it, lol)
the results of the four hands created by the split and played out against the dealer's resulting hand of 5J3 .

clear as mud, right? lol, i hope i didn't muck up the explanation, lmao, i couldn't see the images very well either.

edit: oh yeah and where you see the p1,p2 & p3 in those cells and maybe the 8's are in that row, that's just a place holder and reference sort of thing, in other words the action takes place or my program knows what to do mainly in that row labeled player, if you was wondering about that.

well when ever you get time if you want to comment or what ever would be great, thanks for the ear and thoughts.:)
 
Top