use bitboard::*; use movegen::*; enum MoveUndo { Default { piece_type: PieceType, before: Bitboard, captured_type: PieceType, captured_before: Bitboard, }, Castling { rooks_before: Bitboard, king_before: Bitboard }, Promotion { promoted_to: PieceType, promoted_to_before: Bitboard, } } //01 function negamax(node, depth, color) //02 if depth = 0 or node is a terminal node //03 return color * the heuristic value of node // //04 bestValue := −∞ //05 foreach child of node //06 v := −negamax(child, depth − 1, −color) //07 bestValue := max( bestValue, v ) //08 return bestValue pub fn search() { } /*fn negamax(game: &Game, depth: i32) { }*/