diff options
author | Raúl Benencia <rul@kalgan.cc> | 2015-03-31 16:30:50 -0300 |
---|---|---|
committer | Raúl Benencia <rul@kalgan.cc> | 2015-03-31 16:30:50 -0300 |
commit | e35445bfa3a3ba25a6f8f454f6ba4f1e34913ef4 (patch) | |
tree | 01a447b036a58177b9e9e288d31d300f01e8e094 /lib | |
parent | d8143db289b441562a69dcfa783d7d80c2f544c6 (diff) |
improve var names
Diffstat (limited to 'lib')
-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; } |