예제 #1
0
파일: Program.cs 프로젝트: ranb2002/ai-2016
        /**
         * @param args args[0] Private key
         * @param args args[1] [training|arena]
         * @param args args[2] Game Id
         */

        private static void Main(string[] args)
        {
            if (args.Length < 2)
            {
                Console.WriteLine("Usage: myBot.exe key training|arena gameId");
                Console.WriteLine("gameId is optionnal when in training mode");
                Console.ReadKey();
                return;
            }

            string serverURL = "http://dinf-jdis-ia.dinf.fsci.usherbrooke.ca:80";
            string gameId    = args.Length == 3 ? args[2] : null;

            SimpleBotRunner runner = new SimpleBotRunner(
                new ApiToolkit(serverURL, args[0], args[1] == "training", gameId),
                new Bot());

            runner.Run();

            Console.Read();
        }
예제 #2
0
        /**
         * @param args args[0] Private key
         * @param args args[1] [training|arena]
         * @param args args[2] Game Id
         */

        private static void Main(string[] args)
        {
            if (args.Length < 2)
            {
                Console.WriteLine("Usage: myBot.exe key training|arena gameId");
                Console.WriteLine("gameId is optionnal when in training mode");
                Console.ReadKey();
                return;
            }

            string serverURL = "http://blitz2016.xyz:8080";
            string gameId    = args.Length == 3 ? args[2] : null;

            SimpleBotRunner runner = new SimpleBotRunner(
                new ApiToolkit(serverURL, args[0], args[1] == "training", gameId, 1000),
                new NotSoRandomBot());

            runner.Run();

            Console.Read();
        }
예제 #3
0
        /**
         * @param args args[0] Private key
         * @param args args[1] [training|arena]
         * @param args args[2] Game Id
         */

        private static void Main(string[] args)
        {
            if (args.Length < 2)
            {
                Console.WriteLine("Usage: myBot.exe key training|arena gameId|showbrowser");
                Console.WriteLine("gameId is used to show browser in training mode");
                Console.ReadKey();
                return;
            }

            string serverURL    = "http://blitz2016.xyz:8080";
            string apiKey       = args[0];
            bool   trainingMode = args[1] == "training";
            string gameId       = args.Length == 3 && !trainingMode ? args[2] : null;
            bool   showBrowser  = trainingMode && args.Length == 3;

            IBestChoice bestChoice = new EvenBestChoice();
            IPathfinder pathfinder = new Disjkstra();

            ISimpleBot bot;

            if (bestChoice != null && pathfinder != null)
            {
                bot = new BestBot(bestChoice, pathfinder);
            }
            else
            {
                bot = new RandomBot();
            }

            // add a random param to start browser in training mode
            SimpleBotRunner runner = new SimpleBotRunner(
                new ApiToolkit(serverURL, apiKey, trainingMode, gameId, 1200),
                bot,
                showBrowser);

            runner.Run();

            Console.Read();
        }