C# 统一使用Stockfish国际象棋AI

C# 统一使用Stockfish国际象棋AI,c#,unity3d,artificial-intelligence,uci,C#,Unity3d,Artificial Intelligence,Uci,早上好。我正在尝试将Stockfish实现到Unity国际象棋游戏中,我被告知最好的方法是使用Spawn.Process 有人知道我可以查看并作为参考的现有代码吗 不同的游戏状态是与AI交流的最佳方式吗 谢谢 如果您可以在中表示游戏状态并读取以提升棋盘状态,那么这应该可以: string GetBestMove(string forsythEdwardsNotationString){ var p=新系统.Diagnostics.Process(); p、 StartInfo.FileName=

早上好。我正在尝试将Stockfish实现到Unity国际象棋游戏中,我被告知最好的方法是使用Spawn.Process 有人知道我可以查看并作为参考的现有代码吗

不同的游戏状态是与AI交流的最佳方式吗


谢谢

如果您可以在中表示游戏状态并读取以提升棋盘状态,那么这应该可以:

string GetBestMove(string forsythEdwardsNotationString){
var p=新系统.Diagnostics.Process();
p、 StartInfo.FileName=“stockfishExecutable”;
p、 StartInfo.UseShellExecute=false;
p、 StartInfo.RedirectStandardInput=true;
p、 StartInfo.RedirectStandardOutput=true;
p、 Start();
字符串设置string=“position fen”+forsynthewardsnotationstring;
p、 StandardInput.WriteLine(设置字符串);
//处理5秒
string processString=“go movetime 5000”;
//过程20深
//string processString=“进入深度20”;
p、 StandardInput.WriteLine(processString);
字符串bestMoveInAlgebraicNotation=p.StandardOutput.ReadLine();
p、 Close();
返回bestMoveInAlgebraicNotation;
}

如果您可以在中表示游戏状态并进行读取以提升棋盘状态,那么这应该可以:

string GetBestMove(string forsythEdwardsNotationString){
var p=新系统.Diagnostics.Process();
p、 StartInfo.FileName=“stockfishExecutable”;
p、 StartInfo.UseShellExecute=false;
p、 StartInfo.RedirectStandardInput=true;
p、 StartInfo.RedirectStandardOutput=true;
p、 Start();
字符串设置string=“position fen”+forsynthewardsnotationstring;
p、 StandardInput.WriteLine(设置字符串);
//处理5秒
string processString=“go movetime 5000”;
//过程20深
//string processString=“进入深度20”;
p、 StandardInput.WriteLine(processString);
字符串bestMoveInAlgebraicNotation=p.StandardOutput.ReadLine();
p、 Close();
返回bestMoveInAlgebraicNotation;
}