Example #1
0
 private void SearchEntryPoint()
 {
     try
     {
         var bestMove = IterativeDeepening.FindBestMove(_uciClient.SearchContext);
         _uciClient.Send($"bestmove {bestMove}");
     }
     catch (Exception e)
     {
         Program.OnUnhandledException(this, new UnhandledExceptionEventArgs(e, true));
         Environment.Exit(-1);
     }
 }
        private void Test(BoardState boardState, string name, int depth)
        {
            _interactiveConsole.WriteLine($" == {name}:");

            TranspositionTable.Clear();
            PawnHashTable.Clear();
            EvaluationHashTable.Clear();
            KillerHeuristic.Clear();
            HistoryHeuristic.Clear();

            var context = new SearchContext(boardState)
            {
                MaxDepth = depth
            };

            IterativeDeepening.OnSearchUpdate += IterativeDeepening_OnSearchUpdate;
            IterativeDeepening.FindBestMove(context);
            IterativeDeepening.OnSearchUpdate -= IterativeDeepening_OnSearchUpdate;

            _interactiveConsole.WriteLine();
        }