From: Richard Worth Date: Sat, 5 Nov 2005 22:41:03 +0000 (+0000) Subject: * src/ttt-board.c: (ttt_board_init): Added for loop counter init. X-Git-Url: https://git.cworth.org/git?p=ttt;a=commitdiff_plain;h=ad9f96f734bb560c25ceca4facc85a84f4c3993f * src/ttt-board.c: (ttt_board_init): Added for loop counter init. * src/ttt-board.h: Added prototypes. --- diff --git a/ChangeLog b/ChangeLog index 2bf3f37..e7d6dd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-05 Richard D. Worth + + * src/ttt-board.c: (ttt_board_init): Added for loop counter init. + * src/ttt-board.h: Added prototypes. + 2005-11-05 Richard D. Worth * src/args.c: Renamed ttt-args.c diff --git a/src/ttt-board.c b/src/ttt-board.c index 9a8d719..582b85f 100644 --- a/src/ttt-board.c +++ b/src/ttt-board.c @@ -25,10 +25,11 @@ void ttt_board_init (ttt_board_t *board) { - for (int i; i < TTT_BOARD_MAX_CELLS; i++) - { - &board->cells[i] = 0; - } + int i; + for (i = 0; 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 a4244c0..7f9c92d 100644 --- a/src/ttt-board.h +++ b/src/ttt-board.h @@ -22,11 +22,28 @@ #ifndef _TTT_BOARD_H_ #define _TTT_BOARD_H_ +#include +#include +#include + #define TTT_BOARD_MAX_CELLS 9 -typedef struct _ttt_board { - int cells[TTT_BOARD_MAX_CELLS]; +typedef struct ttt_board { + int 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); + #endif