From f7a3feaacdab2f198c665ee11ff14a63ac84718e Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Wed, 7 Dec 2022 12:28:09 -0800 Subject: added check detection, ran into problem with pointer/array syntax as arguments --- chesshelpers.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'chesshelpers.c') diff --git a/chesshelpers.c b/chesshelpers.c index ed2ad89..a0caadd 100644 --- a/chesshelpers.c +++ b/chesshelpers.c @@ -59,4 +59,12 @@ char* get_move_name(int board[8][8], vector_t origin, vector_t end) { return output; } } - +int** clone_board(int board[8][8]) { + int** newBoard = malloc(8 * 8 * sizeof(int)); + for(int r = 0; r < 8; r++) { + for(int c = 0; c < 8; c++) { + newBoard[c][r] = board[c][r]; + } + } + return newBoard; +} -- cgit v1.3.1