22using namespace GameSolver::Connect4;
35int main(
int argc,
char** argv) {
40 std::string opening_book =
"7x6.book";
41 for(
int i = 1; i < argc; i++) {
42 if(argv[i][0] ==
'-') {
43 if(argv[i][1] ==
'w') weak =
true;
44 else if(argv[i][1] ==
'b') {
45 if(++i < argc) opening_book = std::string(argv[i]);
47 else if(argv[i][1] ==
'a') {
52 solver.loadBook(opening_book);
56 for(
int l = 1; std::getline(std::cin, line); l++) {
58 if(P.
play(line) != line.size()) {
59 std::cerr <<
"Line " << l <<
": Invalid move " << (P.
nbMoves() + 1) <<
" \"" << line <<
"\"" << std::endl;
63 std::vector<int> scores = solver.analyze(P, weak);
64 for(
int i = 0; i < Position::WIDTH; i++) std::cout <<
" " << scores[i];
67 int score = solver.solve(P, weak);
68 std::cout <<
" " << score;
70 std::cout << std::endl;
void play(position_t move)