aboutsummaryrefslogtreecommitdiff
path: root/src/board.h
blob: f7e89f20e267fe2ff0d296adcf5290fa55c672a4 (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
#include "types.h"

#define WHITE  0b0000
#define BLACK  0b0001

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

typedef QWORD Bitboard;

typedef struct {
  Bitboard pieces[12];
  BYTE side;
  BYTE castling_rights;
  BYTE en_passant_square;
} Board;

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

void index_to_notation(BYTE index, char notation[2]);
BYTE notation_to_index(char file, int rank);