예제 #1
0
        private void SendIterationInfo(object sender, SearchCompletedEventArgs e)
        {
            StringBuilder message = new StringBuilder();

            message.Append("info depth ");
            message.Append(e.Ply);
            message.Append(" score ");
            if (e.IsMateScore)
            {
                message.Append("mate ");
            }
            else
            {
                message.Append("cp ");
            }
            message.Append(e.Score);
            message.Append(" nodes ");
            message.Append(e.Nodes);
            message.Append(" nps ");
            message.Append(e.NodesPerSecond);
            message.Append(" hashfull ");
            message.Append(e.HashFull);
            message.Append(" pv");
            foreach (Move move in e.PrincipalVariation)
            {
                message.Append(" ");
                message.Append(move);
            }
            Console.WriteLine(message.ToString());
        }
예제 #2
0
 private void BestMove(object sender, SearchCompletedEventArgs e)
 {
     Console.WriteLine($"bestmove {e.PrincipalVariation[0]}");
 }