Example #1
0
 public NegaMax(Uci uci, TranspTable tabela)
 {
     this.uci       = uci;
     this.avaliador = new Avaliador();
     this.tabela    = tabela;
     age            = 0;
 }
Example #2
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();
 }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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":"")}");
            }
        }
Example #6
0
 static void Main()
 {
     Uci.UciLoop();
 }
Example #7
0
 public Matein2(Uci uci, Game game)
 {
     this.uci  = uci;
     this.game = game;
 }
Example #8
0
 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}");
 }