•      Sign In
• Create Account

### #Actualmudslinger

Posted 11 October 2012 - 11:54 AM

Is this for open faced Chinese poker?

No, it's for this: http://www.gamedev.n...ding-card-game/

I believe this is logically complete, but is still a bit naive:

straight
look for cards with the same face value, keep only one of them in the temporary deck
sort, look for cards with consecutive face values
5+n consecutive cards = n+1 straights (so far)
substitute cards in the straight with the same face value, add each to list

flush
sort the cards by suite,
5+n cards with the same suite = n+1 flushes

full house
sort cards, look for cards that occur >= 3. if none, quit
look for cards that occur in pairs.
C(n1,3) . C(n2,2) for faces that occur >= 3.
C(n,3) . pairs

4 of a kind
sort cards, look for 4 same face values
5th card any other card

straight flush
use previously found straights and flushes, avoid duplicate combinations



I'm still looking at alvaro's code.

### #1mudslinger

Posted 11 October 2012 - 11:53 AM

Is this for open faced Chinese poker?

No, it's for this: http://www.gamedev.net/topic/632575-ai-for-a-simple-shedding-card-game/

I believe this is logically complete, but is still a bit naive:

straight
look for cards with the same face value, keep only one of them in the temporary deck
sort, look for cards with consecutive face values
5+n consecutive cards = n+1 straights (so far)
substitute cards in the straight with the same face value, add each to list
flush
sort the cards by suite,
5+n cards with the same suite = n+1 flushes
full house
sort cards, look for cards that occur >= 3. if none, quit
look for cards that occur in pairs.
C(n1,3) . C(n2,2) for faces that occur >= 3.
C(n,3) . pairs

4 of a kind
sort cards, look for 4 same face values
5th card any other card

straight flush
use previously found straights and flushes, avoid duplicate combinations



I'm still looking at alvaro's code.

PARTNERS