From 75d32f38216f0d23936f62f85d3a1e45b07d543c Mon Sep 17 00:00:00 2001 From: Kevin Worth Date: Sat, 5 Nov 2005 19:53:18 +0000 Subject: [PATCH] * /games/tictactoe/src/ttt-board.c, ttt-board.h: Implemented board_init --- src/ttt-board.c | 5 ++++- src/ttt-board.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ttt-board.c b/src/ttt-board.c index 9e9db98..9a8d719 100644 --- a/src/ttt-board.c +++ b/src/ttt-board.c @@ -25,7 +25,10 @@ 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. diff --git a/src/ttt-board.h b/src/ttt-board.h index dd2b6eb..a4244c0 100644 --- a/src/ttt-board.h +++ b/src/ttt-board.h @@ -22,8 +22,10 @@ #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 -- 2.43.0