X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=src%2Fttt-board.h;h=8983568731520cb7d9e9028a8f467df482b03055;hp=e9498ccca87cfc4b4d7e08bd1f90b9a1e4c4d8df;hb=HEAD;hpb=add37ecc4ee6485d9f91f95f1c983abf867da2c6 diff --git a/src/ttt-board.h b/src/ttt-board.h index e9498cc..8983568 100644 --- a/src/ttt-board.h +++ b/src/ttt-board.h @@ -23,10 +23,20 @@ #define _TTT_BOARD_H_ #include "ttt.h" +#include "ttt-error.h" #define TTT_BOARD_MAX_CELLS 9 -typedef struct _ttt_board ttt_board_t; +typedef enum { + TTT_CELL_EMPTY = '_', + TTT_CELL_X = 'X', + TTT_CELL_O = 'O' +} ttt_cell_t; + +typedef struct _ttt_board { + ttt_cell_t cells[TTT_BOARD_MAX_CELLS]; + ttt_cell_t current_player; +} ttt_board_t; void ttt_board_init (ttt_board_t *board); @@ -41,5 +51,12 @@ ttt_board_to_string (ttt_board_t *board); void ttt_board_write (ttt_board_t *board, FILE *file); +ttt_error_t +ttt_board_make_move (ttt_board_t *board, int move); + +ttt_cell_t +ttt_board_is_won (ttt_board_t *board); + #endif +