-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
70 lines (52 loc) · 1.61 KB
/
main.cpp
File metadata and controls
70 lines (52 loc) · 1.61 KB
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
#include <iostream>
#include <string>
#include "src/test.h"
#include "utility.h"
#include "board.h"
#include "attacks.h"
#include "move.h"
#include "engine.h"
#include "uci.h"
using namespace std;
/* TODO:
* bug checkers somehow for fen depth 6 black side always 2, so perft(6) wrong
* game continues after mate
* last: obstructed für pinned pieces (s. firefox) (idk if solved??))
- move function
- add ep square after ep see test5
- unit tests for:
- play
- generateMoves, bishop, pawn etc..
- finish halfmove clock
- adding const and Reference in Parameter of functions (e.g. in attacks.h/.cpp)
*/
int main(int argc, char *argv[]) {
//alltests();
initAttacks();
perft(5, "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", false);
// Board board("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
// iterativeDeepening(board, 10);
// cout << "H:ETA v1.0 by erikw " << endl;
// loop(argc, argv);
}
/*
int depth = stoi(string(argv[1]));
string fen = argv[2];
//cout << depth;
Board board((string)fen);
for(int i = 3; i < argc; i++) {
Move move((string)argv[i], board);
board.play(Move((string)argv[i], board));
}
MoveList ml(board);
Move *cursor = ml.begin();
string output[ml.size()];
for(int i = 0; i < ml.size(); ++cursor, ++i) {
board.play(*cursor);
output[i] = printSq(cursor->from()) + printSq(cursor->to()) + " " + to_string(perft(depth - 1, board, false));
board.undo(*cursor);
}
sort(output, output + ml.size());
for (string s : output) cout << s << "\n";
cout << "\n" << perft(depth, board, false) << "\n";
*/