protected void Think(Color playerToMove) { MoveList = new MoveList(Board.BoardSize); int lBestValue = Search(playerToMove, SearchOptions.MaxPly, 0); SearchStatus.BestMove = MoveList.GetBestMove(); SearchStatus.BestValue = lBestValue; SearchStatus.CurrentPly = SearchOptions.MaxPly; SearchStatus.MaxPly = SearchOptions.MaxPly; SearchStatus.PercentComplete = 100; }
public override void GoThink() { Think(PlayerToMove); if (Status == SearchStatusType.Thinking) { if ((MoveList.GetBestMove() == CoordinateSystem.PASS) && (SearchOptions.IncludeEndGameMoves)) { SearchOptions.IncludeEndGameMoves = true; SearchOptions.MaxPly = SearchOptions.EndGameMovesMaxPly; Think(PlayerToMove); // fast search } } }
public void BestMove() { int lBoardSize = 9; MoveList lMoveList = new MoveList(lBoardSize); lMoveList.Add(CoordinateSystem.AtFromSGF("C4", lBoardSize), 4); lMoveList.Add(CoordinateSystem.AtFromSGF("A6", lBoardSize), 6); lMoveList.Add(CoordinateSystem.AtFromSGF("A5", lBoardSize), 5); lMoveList.Add(CoordinateSystem.AtFromSGF("E1", lBoardSize), 7); lMoveList.Add(CoordinateSystem.AtFromSGF("A3", lBoardSize), 3); lMoveList.Add(CoordinateSystem.AtFromSGF("D2", lBoardSize), 2); Assert.AreEqual(CoordinateSystem.AtFromSGF("E1", lBoardSize), lMoveList.GetBestMove()); lMoveList.QuickSort(); }