* src/ttt-board.h: Added prototypes.
+2005-11-05 Richard D. Worth <richard@theworths.org>
+
+ * src/ttt-board.c: (ttt_board_init): Added for loop counter init.
+ * src/ttt-board.h: Added prototypes.
+
2005-11-05 Richard D. Worth <richard@theworths.org>
* src/args.c: Renamed ttt-args.c
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.
#ifndef _TTT_BOARD_H_
#define _TTT_BOARD_H_
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#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