示例#1
0
文件: Util.cpp 项目: strikles/poker
int GetNSuited(StdDeck_CardMask hand)
{
	/*
	* 
	*/

	int nsuit[4];

	nsuit[0] = bitcount(StdDeck_CardMask_CLUBS(hand));
	nsuit[1] = bitcount(StdDeck_CardMask_DIAMONDS(hand));
	nsuit[2] = bitcount(StdDeck_CardMask_HEARTS(hand));
	nsuit[3] = bitcount(StdDeck_CardMask_SPADES(hand));

	for(int i=0;i<4;i++) 
	{
		for(int j=i;j<4;j++) 
		{
			if(nsuit[i] > nsuit[j]) 
			{
				int temp = nsuit[i];
				nsuit[i] = nsuit[j];
				nsuit[j] = temp;
			}
		}
	}

	return nsuit[3];
}
示例#2
0
static inline LowHandVal 
StdDeck_Lowball8_EVAL(StdDeck_CardMask cards, int n_cards) {
  uint32 ranks, retval;

  ranks = (StdDeck_CardMask_HEARTS(cards) |
           StdDeck_CardMask_DIAMONDS(cards) |
           StdDeck_CardMask_CLUBS(cards) |
           StdDeck_CardMask_SPADES(cards));
  ranks = Lowball_ROTATE_RANKS(ranks);
  retval = bottomFiveCardsTable[ranks];
  if (retval > 0 && retval <= LowHandVal_WORST_EIGHT)
    return LowHandVal_HANDTYPE_VALUE(StdRules_HandType_NOPAIR) + retval;
  else 
    return LowHandVal_NOTHING;
}
unsigned int wrap_StdDeck_CardMask_CLUBS(StdDeck_CardMask cm) { return StdDeck_CardMask_CLUBS(cm); }