Minimal driver: build a position from a column-index move sequence, solve it with MTD(f), and print the resulting score and the number of plies until the game ends.
Minimal driver: build a position from a column-index move sequence, solve it with MTD(f), and print the resulting score and the number of plies until the game ends.Compile against the library and run with no arguments — the moves 4435 are hard-coded for illustration.
#include <iostream>
std::cerr << "Illegal move sequence\n";
return 1;
}
const int score = solver.
mtdf(b, 0);
std::cout << "score = " << score << " (plies until end = " << plies << ")\n";
return 0;
}
Connect-4 search engine that operates on BitBully::Board.
Perfect-play Connect-4 solver.
static int scoreToMovesLeft(const int score, const Board &b) noexcept
Convert a solver score to the number of moves until the game ends.
int mtdf(const Board &b, const int firstGuess, const int maxDepth=-1) noexcept
Solve a position using the MTD(f) driver.
Connect-4 position represented as a pair of 64-bit bitboards.
bool play(int column)
Drop a stone of the player to move into column.
std::string toString() const
Pretty-printed ASCII representation of the board.
int main(const int argc, const char *const argv[])
Entry point of the benchmark binary.