diff --git a/src/chess.c b/src/chess.c index 2d53520..5b58d8f 100644 --- a/src/chess.c +++ b/src/chess.c @@ -159,14 +159,16 @@ bool validate_move(board_t board, move_t move) { /** TODO: capturing and promotions */ bool perform_move(board_t *board, player_e player, move_t move) { - if (validate_move(*board, move) == true) { + bool move_valid = validate_move(*board, move); + if (move_valid == true) { *board[move.to.y][move.to.x] = move.piece; // move piece to wanted place *board[move.from.y][move.from.x] = NONE; // erase the remnants } + return move_valid; } end_condition_e check_edge_cases(board_t board) { - + return CHECKMATE; } void announce_results(end_condition_e end_condition, player_e player) { diff --git a/src/main.c b/src/main.c index 9d0d8ef..2e5144b 100644 --- a/src/main.c +++ b/src/main.c @@ -1,7 +1,7 @@ // a chess implementation in pure C :) -#include "util.h" #include "chess.h" +#include /** * steps to victory: diff --git a/src/util.h b/src/util.h index 5f057b2..8eeb693 100644 --- a/src/util.h +++ b/src/util.h @@ -5,9 +5,6 @@ // misc. defines and methods -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 - // for input handling consistency void clear_stdin();