summaryrefslogtreecommitdiff
path: root/chesshelpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'chesshelpers.h')
-rw-r--r--chesshelpers.h17
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