]> git.cworth.org Git - ttt/commitdiff
* /games/tictactoe/src/ttt-board.c, ttt-board.h: Implemented board_init
authorKevin Worth <kevin@theworths.org>
Sat, 5 Nov 2005 19:53:18 +0000 (19:53 +0000)
committerKevin Worth <kevin@theworths.org>
Sat, 5 Nov 2005 19:53:18 +0000 (19:53 +0000)
src/ttt-board.c
src/ttt-board.h

index 9e9db9889394a5b719aa1cba68a8b92abf66ec30..9a8d719f95e9a173bc76cfd14d93c1832008a195 100644 (file)
 void
 ttt_board_init (ttt_board_t *board)
 {
-    /* XXX: NYI */
+       for (int i; i < TTT_BOARD_MAX_CELLS; i++)
+       {
+               &board->cells[i] = 0;
+       }
 }
 
 /* Initialize a board from its string representation.
index dd2b6eb14681ffff1f055eb1da94171e230f67ef..a4244c0b30ab595e73e509a8328db76adab2992c 100644 (file)
 #ifndef _TTT_BOARD_H_
 #define _TTT_BOARD_H_
 
+#define TTT_BOARD_MAX_CELLS 9
+
 typedef struct _ttt_board {
-    /* XXX: Fill this out with appropriate fields. */
+       int cells[TTT_BOARD_MAX_CELLS];
 } ttt_board_t;
 
 #endif