|
@@ -99,14 +99,15 @@ std::pair<Move, MoveValue> chessy::miniMax(ChessGame& cg, int depth)
|
|
|
else {
|
|
|
val = -negamaxImplementation(cg, depth - 1, -beta, -alpha);
|
|
|
}
|
|
|
- //cout << move.asString() << ": " << val << ", " << best << ((val > best) ? " good" : " bad") << endl;
|
|
|
- //MoveValue val = 0.0;
|
|
|
cg.undoMove(ui);
|
|
|
- if(val > alpha) {
|
|
|
+ if(val >= alpha) {
|
|
|
alpha = val;
|
|
|
bestMove = move;
|
|
|
}
|
|
|
}
|
|
|
+ if (bestMove.origin == 0 && bestMove.destination == 0) {
|
|
|
+
|
|
|
+ }
|
|
|
return { bestMove, alpha }; //negamaxImplementation(chessGame, 5);
|
|
|
}
|
|
|
|