src/chess/rules.h

changeset 36
ebe0c961e9a6
parent 33
866025982aa9
child 40
47162a7621da
equal deleted inserted replaced
35:6c64b7a073af 36:ebe0c961e9a6
29 29
30 #ifndef RULES_H 30 #ifndef RULES_H
31 #define RULES_H 31 #define RULES_H
32 32
33 #include <stdint.h> 33 #include <stdint.h>
34 #include <time.h> 34 #include <sys/time.h>
35 35
36 #define VALID_MOVE_SYNTAX 0 36 #define VALID_MOVE_SYNTAX 0
37 #define INVALID_MOVE_SYNTAX 1 37 #define INVALID_MOVE_SYNTAX 1
38 #define INVALID_POSITION 2 38 #define INVALID_POSITION 2
39 #define AMBIGUOUS_MOVE 3 39 #define AMBIGUOUS_MOVE 3
67 #define BQUEEN (BLACK|QUEEN) 67 #define BQUEEN (BLACK|QUEEN)
68 #define BKING (BLACK|KING) 68 #define BKING (BLACK|KING)
69 69
70 typedef uint8_t Board[8][8]; 70 typedef uint8_t Board[8][8];
71 71
72
73 typedef struct { 72 typedef struct {
74 uint8_t piece; 73 uint8_t piece;
75 uint8_t fromfile; 74 uint8_t fromfile;
76 uint8_t fromrow; 75 uint8_t fromrow;
77 uint8_t tofile; 76 uint8_t tofile;
78 uint8_t torow; 77 uint8_t torow;
79 uint8_t promotion; 78 uint8_t promotion;
80 struct timespec timestamp; 79 struct timeval timestamp;
81 struct timespec movetime; 80 struct timeval movetime;
82 _Bool check; 81 _Bool check;
83 _Bool capture; 82 _Bool capture;
84 } Move; 83 } Move;
85 84
86 typedef struct MoveList MoveList; 85 typedef struct MoveList MoveList;

mercurial