Exemplo n.º 1
0
        // you can get this code after registration on the server with your email
        //static string ServerUrl = "https://botchallenge.cloud.epam.com/codenjoy-contest/board/player/y2xvmwbn1tkpur93x38n?code=1938052386392496631";
        //static string ServerUrl = "http://127.0.0.1:8080/codenjoy-contest/board/player/y2xvmwbn1tkpur93x38n?code=1938052386392496631";

        static void Main(string[] args)
        {
            //var isLocal = true;
            //var isFile = false;

            //var serverUrl = ConfigurationSettings.AppSettings["connectionString"];
            var serverUrl = Config.ConnectionString;

            if (Config.IsLocal)
            {
                if (Config.PrintBoard)
                {
                    Console.SetWindowSize(Console.LargestWindowWidth - 50, Console.LargestWindowHeight - 3);
                }

                Console.OutputEncoding  = System.Text.Encoding.UTF8;
                Console.BackgroundColor = ConsoleColor.White;
                Console.ForegroundColor = ConsoleColor.Black;

                serverUrl = Config.ConnectionStringLocal;
            }

            // creating custom AI client
            var bot = new YourSolver(serverUrl, Config.IsFile);

            // starting thread with playing game
            //Task.Run(bot.Play);
            bot.Play();

            // waiting for any key
            ReadKey();

            // on any key - asking AI client to stop.
            bot.InitiateExit();
        }
        static void Main(string[] args)
        {
            Console.SetWindowSize(Console.LargestWindowWidth - 3, Console.LargestWindowHeight - 3);

            // creating custom AI client
            var bot = new YourSolver(ServerUrl);

            // starting thread with playing game
            Task.Run(() => bot.Play());

            // waiting for any key
            Console.ReadKey();

            // on any key - asking AI client to stop.
            bot.InitiateExit();
        }