From ef86ae01c852d79555606ca59af17a07287346d1 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Thu, 1 Dec 2022 23:49:25 -0800 Subject: started pawn capture mechanics --- chess.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chess.c b/chess.c index e15a5a7..9cf9a76 100644 --- a/chess.c +++ b/chess.c @@ -97,6 +97,10 @@ int in_board(vector_t position) { int is_empty(int board[8][8], vector_t position) { return board[position.mx][position.my] == 0; } +int get_owner(int board[8][8], vector_t position) { + +} +int vectorp_t get_moves(int board[8][8], vector_t position, piece_t piece) { vector_t* moves = malloc(27 * sizeof(vector_t)); int moveCount = 0; @@ -113,6 +117,8 @@ vectorp_t get_moves(int board[8][8], vector_t position, piece_t piece) { } } } + vector_t captureL = init_vector(position.mx - 1, position.my - 1); + if(in_board(captureL) && return init_vectorp(moves, moveCount); } else if(piece == pawn + 6) { -- cgit v1.3.1