LOA_CELL_EMPTY
} loa_cell_t;
+typedef struct {
+ int x1; int y1;
+ int x2; int y2;
+ loa_bool_t is_capture;
+} loa_move_t;
+
+/* Return a string representation of a move. The return value is a
+ * pointer to a static buffer that will be reused from one call to the
+ * next. So the contents should be copied if needed. This function
+ * call is not thread-safe. */
+const char *
+loa_move_to_string (const loa_move_t *move);
+
+/* Initialize an loa_move_t structure based on a string value,
+ * (presumably the result of loa_move_to_string). Returns TRUE if
+ * successful. */
+loa_bool_t
+loa_move_init_from_string (loa_move_t *move, const char *string);
+
/* The implementation of board_group_size depends on the square of
* BOARD_SIZE being less than or equal to 64. */
#define LOA_BOARD_SIZE 8
int diag_grave_pieces[LOA_DIAG_ARRAY_SIZE];
int diag_acute_pieces[LOA_DIAG_ARRAY_SIZE];
+ int num_moves;
+ loa_move_t *moves;
+ int moves_size;
+
loa_player_t player;
} loa_board_t;
-/* Initialize a board for a new game of Lines of Action. The 12 pieces
+/* Initialize an loa_board_t structure. This function must be called
+ * before passing the board to any other loa_board function. It will
+ * implicitly call loa_board_reset for you. When you are finished
+ * using the board, you should call loa_board_fini. */
+void
+loa_board_init (loa_board_t *board);
+
+/* Free all resources associated with a board. */
+void
+loa_board_fini (loa_board_t *board);
+
+/* Reset board for a new game of Lines of Action. The 12 pieces
* for black and white will be put in their initial places and black
* will be set as the current player. */
void
-loa_board_init (loa_board_t *board);
+loa_board_reset (loa_board_t *board);
/* Does the square at (x,y) belong to a winning group? That is, is
* there a piece at (x,y) that is 8-way connected to all pieces on the