search.rs 765 B

12345678910111213141516171819202122232425262728293031323334
  1. use bitboard::*;
  2. use movegen::*;
  3. enum MoveUndo {
  4. Default {
  5. piece_type: PieceType,
  6. before: Bitboard,
  7. captured_type: PieceType,
  8. captured_before: Bitboard,
  9. },
  10. Castling { rooks_before: Bitboard, king_before: Bitboard },
  11. Promotion {
  12. promoted_to: PieceType,
  13. promoted_to_before: Bitboard,
  14. }
  15. }
  16. //01 function negamax(node, depth, color)
  17. //02 if depth = 0 or node is a terminal node
  18. //03 return color * the heuristic value of node
  19. //
  20. //04 bestValue := −∞
  21. //05 foreach child of node
  22. //06 v := −negamax(child, depth − 1, −color)
  23. //07 bestValue := max( bestValue, v )
  24. //08 return bestValue
  25. pub fn search() {
  26. }
  27. /*fn negamax(game: &Game, depth: i32) {
  28. }*/