コード例 #1
0
        static void RunInterface()
        {
            #region The actual interface

            NeuralNetwork net;

            if (System.IO.File.Exists("weights.txt"))
            {
                net = new NeuralNetwork(4, 790, 64, 1, filename: @"weights.txt");
            }
            else
            {
                net = new NeuralNetwork(4, 790, 64, 1, filename:
                                        @"C:\Users\Gebruiker\Documents\School\_PWS\Code\C#\bin\Release\bestnetworkforfirst4x64run.txt");
            }

            net = new NeuralNetwork(2, 790, 32, 1, filename:
                                    @"C:\Users\Gebruiker\Documents\School\_PWS\Code\C#\bin\Release\bestnet20180108.txt");
            Console.WriteLine("Enter \"uci\" to enter UCI mode. ");
            string[] userInput = Console.ReadLine().Split(' ');
            if (userInput[0] == "uci")
            {
                UCIProtocol.evaluationFunction = net.EvaluatePosition;
                UCIProtocol.InputLoop();
            }

            #endregion
        }
コード例 #2
0
        static void RandomNetworkOpeningTest()
        {
            NeuralNetwork net;

            for (int i = 0; i < 10; i++)
            {
                net = new NeuralNetwork(2, 790, 32, 1);
                net.EvaluatePosition(new Position());
                Move bestMove = Engine.FindBestMove(net.EvaluatePosition, new Position(), 1).Item1;
                Console.WriteLine(UCIProtocol.MoveToUCINotation(bestMove));
            }
            while (true)
            {
                Console.ReadLine();
            }
        }