BitBully
0.0.78
A fast, perfect-play Connect-4 engine in modern C++
Loading...
Searching...
No Matches
with_opening_book.cpp
1
9
#include <filesystem>
10
#include <iostream>
11
12
#include "
BitBully.h
"
13
14
int
main
() {
15
// Path is relative to wherever the binary is launched from.
16
const
std::filesystem::path bookPath =
"openingbook_8ply.bin"
;
17
18
BitBully::BitBully
solver{bookPath};
19
if
(!solver.
isBookLoaded
()) {
20
std::cerr <<
"(book not found, falling back to full search)\n"
;
21
}
22
23
BitBully::Board
b;
// empty starting position
24
const
int
score = solver.
mtdf
(b,
/*firstGuess=*/
0);
25
std::cout <<
"score from start = "
<< score <<
'\n'
;
26
return
0;
27
}
BitBully.h
Connect-4 search engine that operates on BitBully::Board.
BitBully::BitBully
Perfect-play Connect-4 solver.
Definition
BitBully.h:45
BitBully::BitBully::isBookLoaded
bool isBookLoaded() const
Was an opening book successfully loaded?
Definition
BitBully.h:72
BitBully::BitBully::mtdf
int mtdf(const Board &b, const int firstGuess, const int maxDepth=-1) noexcept
Solve a position using the MTD(f) driver.
Definition
BitBully.h:188
BitBully::Board
Connect-4 position represented as a pair of 64-bit bitboards.
Definition
Board.h:204
main
int main(const int argc, const char *const argv[])
Entry point of the benchmark binary.
Definition
main.cpp:108
doxygen_pages
examples
with_opening_book.cpp
Generated by
1.16.1