diff --git a/Chess-Challenge/src/My Bot/MyBot.cs b/Chess-Challenge/src/My Bot/MyBot.cs index 598fbc0..eb2fcba 100644 --- a/Chess-Challenge/src/My Bot/MyBot.cs +++ b/Chess-Challenge/src/My Bot/MyBot.cs @@ -54,7 +54,7 @@ private readonly /// /// Indexed by [][]. /// - private readonly int[,,] historyTable = new int[2, 7, 64]; + private readonly int[] historyTable = new int[4096]; /// /// Killer Move Heuristic for ordering quiet moves. @@ -166,7 +166,7 @@ private int GetMoveScore(Move move, Move tableMove) => // 4. Killer heuristic for quiet moves : killerMoves[board.PlyCount] == move ? 10000 // 5. History heuristic for quiet moves - : 100_000_000 - historyTable[board.PlyCount & 1, (int)move.MovePieceType, move.TargetSquare.Index]; + : 100_000_000 - historyTable[move.RawValue & 4095]; /// /// Performs an Alpha-Beta search with @@ -348,7 +348,7 @@ private int AlphaBeta(int depth, int alpha, int beta, bool nullMoveAllowed = tru void UpdateHistory(Move move, int bonus) { - ref int entry = ref historyTable[board.PlyCount & 1, (int)move.MovePieceType, move.TargetSquare.Index]; + ref int entry = ref historyTable[move.RawValue & 4095]; entry += 32 * bonus * depth - entry * depth * depth / 512; } }