In the code that you have posted,
Code:
#define CA0(xo) \
( \
( BOARD[0] == BOARD[1] == BOARD[2] ) && BOARD[0] == (xo)
)
#define CA1(xo) \
( \
( BOARD[3] == BOARD[4] == BOARD[5] ) && BOARD[3] == (xo)
)
#define CA2(xo) \
( \
( BOARD[3] == BOARD[4] == BOARD[5] ) && BOARD[3] == (xo)
)
#define ACROSS(xo) \
( CA0(xo) || CA1(xo) || CA2(xo) )
The final #define, is to check the diagonals of the board. I can't understand how that statment works. (if it checks diagonals). And there is a typo error in #define CA2(x0) . It should be
Code:
#define CA2(xo) \
( \
( BOARD[6] == BOARD[7] == BOARD[8] ) && BOARD[6] == (xo)
)