public NegaMax(Uci uci, TranspTable tabela) { this.uci = uci; this.avaliador = new Avaliador(); this.tabela = tabela; age = 0; }
public NetworkReceiver(int port, Action <UciRequest, string> action) { _server = new Server { Services = { Uci.BindService(new UciImpl(action)) }, Ports = { new ServerPort("0.0.0.0", port, ServerCredentials.Insecure) } }; _server.Start(); }
public void MoveFromUciBasicTest() { const string uciMove = "a2a3"; var expected = new Rudz.Chess.Types.Move(Squares.a2, Squares.a3); var uci = new Uci(); var game = GameFactory.Create(); game.NewGame(); var actual = uci.MoveFromUci(game.Pos, uciMove); actual.Should().Be(expected); }
public void NpsSimpleTest() { const ulong expected = 0UL; const ulong nodes = 1000UL; var ts = TimeSpan.FromSeconds(1); var uci = new Uci(); var actual = uci.Nps(nodes, ts); actual.Should().Be(expected); }
void AnnounceMate() { if (IsMateScore(bestEvalThisIteration)) { int numPlyToMate = NumPlyToMateFromScore(bestEvalThisIteration); //int numPlyToMateAfterThisMove = numPlyToMate - 1; int numMovesToMate = (int)Ceiling(numPlyToMate / 2f); string sideWithMate = (bestEvalThisIteration * ((board.WhiteToMove) ? 1 : -1) < 0) ? "Black" : "White"; Uci.Log($"{sideWithMate} can mate in {numMovesToMate} move{((numMovesToMate>1)?"s":"")}"); } }
static void Main() { Uci.UciLoop(); }
public Matein2(Uci uci, Game game) { this.uci = uci; this.game = game; }
void LogDebugInfo() { AnnounceMate(); Uci.Log($"Best move: {bestMoveThisIteration.Name} Eval: {bestEvalThisIteration} Search time: {searchStopwatch.ElapsedMilliseconds} ms."); Uci.Log($"Num nodes: {numNodes} num Qnodes: {numQNodes} num cutoffs: {numCutoffs} num TThits {numTranspositions}"); }