-
Notifications
You must be signed in to change notification settings - Fork 1
API Reference
Trent M. Wyatt edited this page Apr 23, 2025
·
1 revision
template<
typename GameState,
typename Move,
int MaxMoves,
int MaxDepth = 8>
class Minimax;| Method | Description |
|---|---|
Move findBestMove(const GameState& state) |
Returns the optimal move up to MaxDepth. |
int getBestScore() const |
Score from last search. |
int getNodesSearched() const |
Node count from last search. |
Derive from this and override all five pure virtuals:
class GameLogic {
public:
virtual int evaluate(const GameState&) = 0;
virtual int generateMoves(const GameState&, Move[], int max) = 0;
virtual void applyMove(GameState&, const Move&) = 0;
virtual bool isTerminal(const GameState&) = 0;
virtual bool isMaximizingPlayer(const GameState&) = 0;
};Tip: Use constexpr values inside your Board type to avoid globals.
© 2025 Trent M. Wyatt