* src/ttt-board.c: (ttt_board_init): Added for loop counter init.
authorRichard Worth <richard@theworths.org>
Sat, 5 Nov 2005 22:41:03 +0000 (22:41 +0000)
committerRichard Worth <richard@theworths.org>
Sat, 5 Nov 2005 22:41:03 +0000 (22:41 +0000)
        * src/ttt-board.h: Added prototypes.

ChangeLog
src/ttt-board.c
src/ttt-board.h

index 2bf3f375ffac19dc3161cf852058963ced0c71ee..e7d6dd684dcb0fbb2c56ebf977b39b60b4b3a7fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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
index 9a8d719f95e9a173bc76cfd14d93c1832008a195..582b85fd6469e7cbcc1d460eb02dc50ef51684b6 100644 (file)
 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.
index a4244c0b30ab595e73e509a8328db76adab2992c..7f9c92dd1ea365fed55ff1082c0821ccf9e5666a 100644 (file)
 #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