-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.cpp
75 lines (71 loc) · 1.96 KB
/
debug.cpp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <iostream>
#include "moves.h"
#include "utils.h"
void print_board(u64 black, u64 white) {
u64 mask = 0x8000000000000000;
std::cout << "C a b c d e f g h" << std::endl;
for (int i = 0; i < 8; ++i) {
std::cout << "C " << i+1 << " ";
for (int j = 0; j < 8; ++j) {
if ((white & mask) != 0UL) {
std::cout << "W ";
} else if ((black & mask) != 0UL) {
std::cout << "B ";
}else {
std::cout << "- ";
}
black <<= 1;
white <<= 1;
}
std::cout << "\n";
}
std::cout << "C \n";
}
void print_uint(u64 bits) {
u64 mask = 0x8000000000000000;
std::cout << "C a b c d e f g h" << std::endl;
for (int i = 0; i < 8; ++i) {
std::cout << "C " << i + 1 << " ";
for (int j = 0; j < 8; ++j) {
if ((bits & mask) != 0UL) {
std::cout << "X ";
}else {
std::cout << "- ";
}
bits <<= 1;
}
std::cout << "\n";
}
std::cout << "C \n";
}
void print_legal_moves(u64 black, u64 white, bool isBlack) {
u64 moves;
if (isBlack) {
moves = get_legal_moves(black, white);
}else {
moves = get_legal_moves(white, black);
}
u64 mask = 0x8000000000000000;
std::cout << "C a b c d e f g h" << std::endl;
for (int i = 0; i < 8; ++i) {
std::cout << "C " << i + 1 << " ";
for (int j = 0; j < 8; ++j) {
if ((white & mask) != 0) {
std::cout << "W ";
}
else if ((black & mask) != 0) {
std::cout << "B ";
}
else if ((moves & mask) != 0) {
std::cout << "@ ";
}else {
std::cout << "- ";
}
black <<= 1;
white <<= 1;
moves <<= 1;
}
std::cout << "\n";
}
std::cout << "C \n";
}