]> git.cworth.org Git - ttt/blobdiff - src/ttt-board.h
Moved ttt_board_make_move to ttt-board.c with comment added and prototype in ttt...
[ttt] / src / ttt-board.h
index a4244c0b30ab595e73e509a8328db76adab2992c..c240ef3398d8fefae891f01ec6bb376bc5054eff 100644 (file)
 #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 {
-       int cells[TTT_BOARD_MAX_CELLS];
+    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);
+
+int 
+ttt_board_make_move (ttt_board_t *board, int move);
+
+
 #endif