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
14int 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}
Connect-4 search engine that operates on BitBully::Board.
Perfect-play Connect-4 solver.
Definition BitBully.h:45
bool isBookLoaded() const
Was an opening book successfully loaded?
Definition BitBully.h:72
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
Connect-4 position represented as a pair of 64-bit bitboards.
Definition Board.h:204
int main(const int argc, const char *const argv[])
Entry point of the benchmark binary.
Definition main.cpp:108