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) || \
25 #define ON_DIAGONAL_1(a, b) ((a) == (b))
26 #define ON_DIAGONAL_2(a, b) ((b) == ((g_uBoardSize - a) - 1))
27 #define GOOD_COORD(x) ((x) < g_uBoardSize)
29 typedef signed char SQUARE;
30 #define IS_SQUARE_EMPTY(x) (x == EMPTY)
33 // A (simple) representation of a tic tac toe position
35 typedef struct _POSITION
39 //SQUARE sBoard[BOARD_SIZE][BOARD_SIZE];
41 //int iVSums[BOARD_SIZE];
43 //int iHSums[BOARD_SIZE];
45 unsigned int uNumEmpty;
48 #define NUM_TO_HPOS(x) ((x) % g_uBoardSize)
49 #define NUM_TO_VPOS(x) ((x) / g_uBoardSize)
50 #define VALID_SUM(x) (abs(x) <= g_uBoardSize)
53 // A representation of a move in a tic tac toe game
55 typedef unsigned int COORD;
67 #define INFINITY (+100)
71 // An assert mechanism
74 #define ASSERT(x) if (x) \
77 { (void) _assert(__FILE__, __LINE__); }
84 _assert(char *sz, unsigned int i)
86 fprintf(stderr, "Assertion failed in %s at line %u.\n", sz, i);
89 #elif defined(__unix__)