1 /*
2  * Copyright (C) 2002 Michael Maurer <mjmaurer@yahoo.com>
3  *
4  * This program gives you software freedom; you can copy, convey,
5  * propagate, redistribute and/or modify this program under the terms of
6  * the GNU General Public License (GPL) as published by the Free Software
7  * Foundation (FSF), either version 3 of the License, or (at your option)
8  * any later version of the GPL published by the FSF.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program in a file in the toplevel directory called "GPLv3".
17  * If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef __EVAL_LOW8_H__
20 #define __EVAL_LOW8_H__
21 
22 #include "handval_low.h"
23 
24 static inline LowHandVal
StdDeck_Lowball8_EVAL(StdDeck_CardMask cards,int n_cards)25 StdDeck_Lowball8_EVAL(StdDeck_CardMask cards, int n_cards) {
26   uint32 ranks, retval;
27 
28   ranks = (StdDeck_CardMask_HEARTS(cards) |
29            StdDeck_CardMask_DIAMONDS(cards) |
30            StdDeck_CardMask_CLUBS(cards) |
31            StdDeck_CardMask_SPADES(cards));
32   ranks = Lowball_ROTATE_RANKS(ranks);
33   retval = bottomFiveCardsTable[ranks];
34   if (retval > 0 && retval <= LowHandVal_WORST_EIGHT)
35     return LowHandVal_HANDTYPE_VALUE(StdRules_HandType_NOPAIR) + retval;
36   else
37     return LowHandVal_NOTHING;
38 }
39 
40 #endif
41