X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=src%2Fttt-board.h;h=b04d4b3870116240421ab23dec08b9c7b38aec1e;hp=dd2b6eb14681ffff1f055eb1da94171e230f67ef;hb=c25df0131987fe52be7430c5be03ec83fbaea9b3;hpb=cce891bb05118330ca609ac989491ad8a2fa7f71 diff --git a/src/ttt-board.h b/src/ttt-board.h index dd2b6eb..b04d4b3 100644 --- a/src/ttt-board.h +++ b/src/ttt-board.h @@ -22,9 +22,32 @@ #ifndef _TTT_BOARD_H_ #define _TTT_BOARD_H_ +#include "ttt.h" + +#define TTT_BOARD_MAX_CELLS 9 + +typedef enum { + TTT_CELL_EMPTY = '_', + TTT_CELL_X = 'X', + TTT_CELL_O = 'O' +} ttt_cell_t; + typedef struct _ttt_board { - /* XXX: Fill this out with appropriate fields. */ + ttt_cell_t cells[TTT_BOARD_MAX_CELLS]; } ttt_board_t; +void +ttt_board_init (ttt_board_t *board); + +void +ttt_board_init_from_string (ttt_board_t *board, + const char *s); + +char * +ttt_board_to_string (ttt_board_t *board); + +void +ttt_board_write (ttt_board_t *board, FILE *file); + #endif