diff options
| author | KaiStevenson <kai@kaistevenson.com> | 2022-12-06 22:16:12 -0800 |
|---|---|---|
| committer | KaiStevenson <kai@kaistevenson.com> | 2022-12-06 22:16:12 -0800 |
| commit | 7ef39a806620b05555125f4fdb99889442a4d6e3 (patch) | |
| tree | 9a0da2f851f9d70536635a4ec1599d301750665a /chesshelpers.h | |
| parent | e8e00b9eb6e3979dd1066fc3a73f39565e8ec9cf (diff) | |
separated code into multiple files
Diffstat (limited to 'chesshelpers.h')
| -rw-r--r-- | chesshelpers.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 |
