Remove more CRs.
[ttt.git] / ver0 / ttt.h
1 #ifndef _TTT_H_
2 #define _TTT_H_
3
4 #define TRUE (1)
5 #define FALSE (0)
6
7 #define IN
8 #define OUT
9
10 typedef unsigned int BOOL;
11
12 //
13 // Constants for each state a board square can be in and a programmer
14 // defined type for these states.
15 //
16 #define X_MARK (-1)
17 #define EMPTY  (0)
18 #define O_MARK (+1)
19 #define TIE    (+2)
20
21 typedef signed char SQUARE;
22 #define IS_SQUARE_EMPTY(x) (x == EMPTY)
23
24 //
25 // A (simple) representation of a tic tac toe position
26 //
27 #define BOARD_SIZE (3)
28
29 typedef struct _POSITION
30 {
31     SQUARE sWhoseTurn;
32     SQUARE sBoard[BOARD_SIZE][BOARD_SIZE];
33     unsigned int uNumEmpty;
34 } POSITION;
35
36 //
37 // A representation of a move in a tic tac toe game
38 //
39 typedef unsigned int COORD;
40
41 typedef struct _MOVE
42 {
43     COORD cHpos;
44     COORD cVpos;
45     SQUARE sMark;
46 } MOVE;
47
48 #endif /* _TTT_H_ */