#ifndef _TTT_BOARD_H_
#define _TTT_BOARD_H_
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#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
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
+