summaryrefslogtreecommitdiff
path: root/src/pieces.h
blob: a88626a22b5560b44338a23cf2a6176dcba1c9b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#define WHITE  0b0000
#define BLACK  0b0001
#define NO_COLOR 0b1110

char* COLORS[] = { "white", "black" };


#define EMPTY  0b0000
#define VISUAL 0b0001

#define PAWN   0b0010
#define KNIGHT 0b0100
#define BISHOP 0b0110
#define ROOK   0b1000
#define QUEEN  0b1010
#define KING   0b1100


char* pieces[] = {
  ".", "*",
  "♟︎", "♙",
  "♞", "♘",
  "♝", "♗",
  "♜", "♖",
  "♛", "♕",
  "♚", "♔",
};

int bishopMoves[] = { 17, 15, -17, -15, 0 };
int rookMoves[] = { 16, 1, -1, -16, 0 };
int queenMoves[] = { 17, 16, 15, 1, -1, -15, -16, -17, 0 };
int knightMoves[] = { 33, 31, 18, 14, -33, -31, -18, -14, 0 };
int kingMoves[] = { 17, 16, 15, 1, -1, -15, -16, -17, 0 };

int pawnMoves[] = { 16, 0 };
int blackPawnMoves[] = { 16, 0 };

int newPawnMoves[] = { 32, 16, 0 };
int newBlackPawnMoves[] = { -32, -16, 0 };

int pawnAttackMoves[] = { 17, 15, 0 };
int blackPawnAttackMoves[] = { -17, -15, 0 };

#define FILE_MASK 0b1111

#define DESTINATION_MASK 0b1111111