63 #define BQUEEN (BLACK|QUEEN) |
63 #define BQUEEN (BLACK|QUEEN) |
64 #define BKING (BLACK|KING) |
64 #define BKING (BLACK|KING) |
65 |
65 |
66 typedef uint8_t Board[8][8]; |
66 typedef uint8_t Board[8][8]; |
67 |
67 |
|
68 typedef struct { |
|
69 uint8_t piece; |
|
70 uint8_t fromfile; |
|
71 uint8_t fromrow; |
|
72 uint8_t tofile; |
|
73 uint8_t torow; |
|
74 _Bool check; |
|
75 _Bool capture; |
|
76 } Move; |
|
77 |
|
78 #define isfile(file) (file >= 'a' && file <= 'h') |
|
79 #define isrow(row) (row >= '1' && row <= '8') |
|
80 #define rowidx(row) (row-'1') |
|
81 #define fileidx(file) (file-'a') |
|
82 |
68 void game_start(Settings *settings, int opponent); |
83 void game_start(Settings *settings, int opponent); |
69 |
84 |
70 #ifdef __cplusplus |
85 #ifdef __cplusplus |
71 } |
86 } |
72 #endif |
87 #endif |