Minimax.h 947 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef CHESSY_MINIMAX_H
  2. #define CHESSY_MINIMAX_H
  3. #include <iostream>
  4. #include <utility>
  5. #include "MoveGeneration.h"
  6. namespace chessy
  7. {
  8. using MoveValue = float;
  9. /*!
  10. * \brief conducts a performance test iterating through all positions
  11. * up to a specified depth.
  12. *
  13. * \param out the stream to write info to
  14. * \param chessGame the game to iterate through the positions
  15. * \param depth how deep to search (in halfmoves)
  16. *
  17. * \return the number of nodes visited
  18. */
  19. size_t perft(std::ostream& out, ChessGame& chessGame, int depth);
  20. std::pair<Move, MoveValue> miniMax(ChessGame& chessGame, int depth);
  21. MoveValue negamaxImplementation(ChessGame& cg, int depth,
  22. MoveValue alpha, MoveValue beta);
  23. template<Side side>
  24. MoveValue evaluatePositives(const ChessGame& game);
  25. MoveValue evaluate(Side side, const ChessGame& game);
  26. }
  27. #endif // CHESSY_MIrIMAX_H