4 #define ALPHA_BETA_SEARCH 1
12 typedef unsigned int BOOL;
15 // Constants for each state a board square can be in and a programmer
16 // defined type for these states.
22 #define OPPOSITE_MARK(m) ((m) * -1)
23 #define X_OR_O(m) (((m) == X_MARK) || \
26 typedef signed char SQUARE;
27 #define IS_SQUARE_EMPTY(x) (x == EMPTY)
30 // A (simple) representation of a tic tac toe position
32 typedef struct _POSITION
36 //SQUARE sBoard[BOARD_SIZE][BOARD_SIZE];
38 //int iVSums[BOARD_SIZE];
40 //int iHSums[BOARD_SIZE];
42 unsigned int uNumEmpty;
45 #define NUM_TO_HPOS(x) ((x) % g_uBoardSize)
46 #define NUM_TO_VPOS(x) ((x) / g_uBoardSize)
47 #define VALID_SUM(x) (abs(x) <= g_uBoardSize)
50 // A representation of a move in a tic tac toe game
52 typedef unsigned int COORD;
64 #define INFINITY (+100)
68 // An assert mechanism
71 #define ASSERT(x) if (x) \
74 { (void) _assert(__FILE__, __LINE__); }
81 _assert(char *sz, unsigned int i)
83 fprintf(stderr, "Assertion failed in %s at line %u.\n", sz, i);
86 #elif defined(__unix__)