diff options
-rw-r--r-- | lib/game.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -10,7 +10,7 @@ * Return 1 if the received player is checkmated. Returns 0 otherwise. * TODO */ -int game_is_checkmate(Board b, Color p) { +int game_is_checkmate(Board board, Color player) { return 0; } @@ -18,18 +18,18 @@ int game_is_checkmate(Board b, Color p) { * Check if a move is valid in the received board for the received player. * TODO. */ -int game_is_move_valid(Board b, Color p, Move m) { +int game_is_move_valid(Board board, Color player, Move move) { return 1; } -Board game_loop(Board board) { - Board b = board; +Board game_loop(Board b) { + Board board = b; Color current_player = WHITE; Move m; int move_valid; - while (!game_is_checkmate(b, current_player)) { - print_board(b, current_player); + while (!game_is_checkmate(board, current_player)) { + print_board(board, current_player); putchar('\n'); if (current_player == WHITE) @@ -41,13 +41,13 @@ Board game_loop(Board board) { while (!move_valid) { m = input_move(); - if (game_is_move_valid(b, current_player, m)) + if (game_is_move_valid(board, current_player, m)) move_valid = 1; else printf("Invalid move. Please, try again. "); } - b = board_make_move(b, m); + board = board_make_move(board, m); current_player = current_player == WHITE ? BLACK : WHITE; } |