From e35445bfa3a3ba25a6f8f454f6ba4f1e34913ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Tue, 31 Mar 2015 16:30:50 -0300 Subject: improve var names --- lib/game.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/game.c') diff --git a/lib/game.c b/lib/game.c index 63c69ba..0ebd819 100644 --- a/lib/game.c +++ b/lib/game.c @@ -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; } -- cgit v1.2.3