From 7ef39a806620b05555125f4fdb99889442a4d6e3 Mon Sep 17 00:00:00 2001 From: KaiStevenson Date: Tue, 6 Dec 2022 22:16:12 -0800 Subject: separated code into multiple files --- chesshelpers.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 chesshelpers.h (limited to 'chesshelpers.h') diff --git a/chesshelpers.h b/chesshelpers.h new file mode 100644 index 0000000..57a6440 --- /dev/null +++ b/chesshelpers.h @@ -0,0 +1,17 @@ +#include "vector.h" +#ifndef CHESS_HELPERS +#define CHESS_HELPERS +typedef enum { + pawn = 1, + knight = 2, + bishop = 3, + rook = 4, + queen = 5, + king = 6, +} piece_t; +int in_board(vector_t position); +int is_empty(int board[8][8], vector_t position); +int is_color(int board[8][8], vector_t position, int color); +char* get_readable_coords(vector_t position); +char* get_move_name(int board[8][8], vector_t origin, vector_t end); +#endif -- cgit v1.3.1