1
1
/* portability-macros header prefix */
4
#define LONGLONG long long
3
7
/* Windows requires a __declspec(dllexport) tag, etc */
5
9
# define DLLEXPORT __declspec(dllexport)
67
71
#define Max(x, y) (((x) >= (y)) ? (x) : (y))
68
72
#define Min(x, y) (((x) <= (y)) ? (x) : (y))
74
/* "hand" is leading hand, "relative" is hand relative leading
76
The handId macro implementation follows a solution
78
All hand identities are given as
79
0=NORTH, 1=EAST, 2=SOUTH, 3=WEST. */
81
#define handId(hand, relative) (hand + relative) & 3
70
83
struct gameInfo { /* All info of a particular deal */
222
240
extern struct nodeCardsType **pn;
223
241
extern struct posSearchType **pl;
226
extern int handStore[4][4]; /* All hand identities are given as
227
0=NORTH, 1=EAST, 2=SOUTH, 3=WEST.
228
Player is the hand whose move is to be
230
1st index is first hand, 2nd index
231
is hand relative first. The value is
232
the absolute value, NORTH, EAST,
233
SOUTH, WEST of the hand pointed to
243
extern int * highestRank;
244
extern int * counttable;
245
extern struct adaptWinRanksType * adaptWins;
235
246
extern unsigned short int bitMapRank[16];
236
247
extern unsigned short int iniRemovedRanks[4];
237
248
extern unsigned short int relRankInSuit[4][4];
297
308
void UpdateWinner(struct pos * posPoint, int suit);
298
309
void UpdateSecondBest(struct pos * posPoint, int suit);
299
310
int WinningMove(struct moveType * mvp1, struct moveType * mvp2);
300
unsigned short int CountOnes(unsigned short int b);
301
311
int AdjustMoveList(void);
302
312
int QuickTricks(struct pos * posPoint, int hand,
303
313
int depth, int target, int *result);
311
321
struct winCardType * nodeP, int firstHand,
312
322
int target, int tricks, int * valp);
313
323
struct cardType NextCard(struct cardType card);
314
struct nodeCardsType * BuildPath(struct pos * posPoint, int firstHand,
315
int tricks, struct posSearchType *nodep, int * result);
324
struct nodeCardsType * BuildPath(struct pos * posPoint,
325
struct posSearchType *nodep, int * result);
316
326
void BuildSOP(struct pos * posPoint, int tricks, int firstHand, int target,
317
327
int depth, int scoreFlag, int score);
318
328
struct posSearchType * SearchLenAndInsert(struct posSearchType
319
329
* rootp, LONGLONG key, int insertNode, int *result);
320
330
void Undo(struct pos * posPoint, int depth);
321
331
int CheckDeal(struct moveType * cardp);
322
void WinAdapt(struct pos * posPoint, int depth, struct nodeCardsType * cp,
323
unsigned short int aggr[]);
324
332
int InvBitMapRank(unsigned short bitMap);
325
333
int InvWinMask(int mask);
326
334
void ReceiveTTstore(struct pos *posPoint, struct nodeCardsType * cardsP, int target, int depth);
327
int DismissX(struct pos *posPoint, int depth);
335
int NextMove(struct pos *posPoint, int depth);
328
336
int DumpInput(int errCode, struct deal dl, int target, int solutions, int mode);
330
338
void AddNodeSet(void);