X-Git-Url: https://git.cworth.org/git?p=dvonn;a=blobdiff_plain;f=dvonn-board.c;h=f80277531ee7a8ee9bf71ba616a2e8c2ca69ea45;hp=795ff5531d6ed2726e4b24907ccbb5ecbc5fe96f;hb=2c8c385d00f60fad7a4b74b0b66516fbce62c50f;hpb=f484053e7018a5bff5b93fa36d9a2de5a873da35 diff --git a/dvonn-board.c b/dvonn-board.c index 795ff55..f802775 100644 --- a/dvonn-board.c +++ b/dvonn-board.c @@ -147,6 +147,8 @@ dvonn_board_place (dvonn_board_t *board, else board->cells[x][y].type = DVONN_CELL_WHITE; + board->cells[x][y].height = 1; + board->moves++; if (board->moves == 49) { @@ -171,7 +173,11 @@ dvonn_board_move (dvonn_board_t *board, if (! dvonn_board_move_legal (board, x1, y1, x2, y2, error)) return FALSE; - /* XXX: Need to execute the move here. */ + board->cells[x2][y2].height += board->cells[x1][y1].height; + board->cells[x2][y2].type = board->cells[x1][y1].type; + + board->cells[x1][y1].type = DVONN_CELL_EMPTY; + board->cells[x1][y1].height = 0; dvonn_board_next_player (board);