#ifndef _TTT_H_ #define _TTT_H_ #define TRUE (1) #define FALSE (0) #define IN #define OUT typedef unsigned int BOOL; // // Constants for each state a board square can be in and a programmer // defined type for these states. // #define X_MARK (-1) #define EMPTY (0) #define O_MARK (+1) #define TIE (+2) typedef signed char SQUARE; #define IS_SQUARE_EMPTY(x) (x == EMPTY) // // A (simple) representation of a tic tac toe position // #define BOARD_SIZE (3) typedef struct _POSITION { SQUARE sWhoseTurn; SQUARE sBoard[BOARD_SIZE][BOARD_SIZE]; unsigned int uNumEmpty; } POSITION; // // A representation of a move in a tic tac toe game // typedef unsigned int COORD; typedef struct _MOVE { COORD cHpos; COORD cVpos; SQUARE sMark; } MOVE; #endif /* _TTT_H_ */