diff --git a/src/Aiursoft.ChessServer/Aiursoft.ChessServer.csproj b/src/Aiursoft.ChessServer/Aiursoft.ChessServer.csproj index 4a49666..f400139 100644 --- a/src/Aiursoft.ChessServer/Aiursoft.ChessServer.csproj +++ b/src/Aiursoft.ChessServer/Aiursoft.ChessServer.csproj @@ -10,12 +10,12 @@ enable - - - - - + + + + + - + \ No newline at end of file diff --git a/src/Aiursoft.ChessServer/Services/ChessEngine.cs b/src/Aiursoft.ChessServer/Services/ChessEngine.cs index 236a360..6d8089d 100644 --- a/src/Aiursoft.ChessServer/Services/ChessEngine.cs +++ b/src/Aiursoft.ChessServer/Services/ChessEngine.cs @@ -39,9 +39,8 @@ public class ChessEngine _engine.AdjustPosition($"position fen {fen}"); var positionClone = new Position(_engine.Game.CurrentPosition); - var depth = difficulty - 1; - var result = _engine.IDDFS(depth, 10); - _engine.Game.ResetCurrentPositionToBeforeSearchState(); - return result.BestMove.ToEPDString(positionClone); + return _engine.BestMove(new($"go depth {difficulty}")) + .BestMove + .ToEPDString(positionClone); } } \ No newline at end of file diff --git a/tests/Aiursoft.ChessServer.Tests/Aiursoft.ChessServer.Tests.csproj b/tests/Aiursoft.ChessServer.Tests/Aiursoft.ChessServer.Tests.csproj index b4fe387..b0b162f 100644 --- a/tests/Aiursoft.ChessServer.Tests/Aiursoft.ChessServer.Tests.csproj +++ b/tests/Aiursoft.ChessServer.Tests/Aiursoft.ChessServer.Tests.csproj @@ -9,15 +9,15 @@ enable - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + - - - + + +