X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=src%2Fttt-board.h;h=c75c168960f9ebac1e49dfc3f5c0863b82af0cf6;hp=7f9c92dd1ea365fed55ff1082c0821ccf9e5666a;hb=b90882d3a092c28bdedf84271f1eca8b1744577c;hpb=ad9f96f734bb560c25ceca4facc85a84f4c3993f diff --git a/src/ttt-board.h b/src/ttt-board.h index 7f9c92d..c75c168 100644 --- a/src/ttt-board.h +++ b/src/ttt-board.h @@ -22,14 +22,20 @@ #ifndef _TTT_BOARD_H_ #define _TTT_BOARD_H_ -#include -#include -#include +#include "ttt.h" +#include "ttt-error.h" #define TTT_BOARD_MAX_CELLS 9 -typedef struct ttt_board { - int cells[TTT_BOARD_MAX_CELLS]; +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 @@ -45,5 +51,9 @@ 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); + #endif +