--- In [email protected], "idiodine2000" <[EMAIL PROTECTED]> 
wrote:
> 
> 
> does anyone have a code or can make a code that can tell what type 
> of hand you have (flush, pair, 4 of a kind, etc.) out of 7 cards on 
> the table?

     One way to approach this:  

dim Card(7) as string

private sub AssignCardValues

card(1)="2S" ' 2 of spades
card(2)="3S" ' 3 of spades
card(3)="4S" '4 of spades
card(4)="5S" '5 of spades
card(5)="6S" ' 6 spades
card(6)="7S" '7 spades
card(7)="8S" '8 Spades

end sub

private sub ReadCards

if Card(1)="2S" and _
   card(2)="3S" and _
   card(3)="4S" and _
   card(4)="5S" and _
   card(5)="6S" and _
   card(6)="7S" and _
   card(7)="8S" then
        msgbox"Straight Flush"
end if

end sub

...or something like that.

Many ways to approach this but the basic logic is the same...

For randomly generated cards you would need some more powerful code, 
such as...

if right(card(1),1) = "S" and _
   right(card(2),1) = "S" and _
   right(card(3),1) = "S" and _
   right(card(4),1)= "S" and_
   right(card(5),1)="S" and _
   right(card(6),1)="S" and_
   right(card(7),1)="S" then
     Flush=true
end if



just a quick reply to get you started.

There are more efficient ways to code this but this should give you a 
general idea of the logic required...











'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [email protected]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to