summaryrefslogtreecommitdiff
path: root/chesshelpers.c
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2022-12-07 12:28:09 -0800
committerKai Stevenson <kai@kaistevenson.com>2022-12-07 12:28:09 -0800
commitf7a3feaacdab2f198c665ee11ff14a63ac84718e (patch)
tree0f032e5ebf8755c00a0d8fa167377444b84d3065 /chesshelpers.c
parent3b665031ee3b74842e181e3f0a738b77745f1f39 (diff)
added check detection, ran into problem with pointer/array syntax as arguments
Diffstat (limited to 'chesshelpers.c')
-rw-r--r--chesshelpers.c10
1 files changed, 9 insertions, 1 deletions
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;
+}