diff options
Diffstat (limited to 'chesshelpers.c')
| -rw-r--r-- | chesshelpers.c | 10 |
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; +} |
