Пример #1
0
 public virtual Command GenerateCommand(GameSetup gameSetup)
 {
     if (_random.NextDouble() > 0.5)
     {
         return Command.Fire(_random.Next(90) - 45, _random.Next(100) + 30);
     }
     else
     {
         return Command.Move(_random.NextDouble() > 0.5 ? -100 : 100);
     }
 }
Пример #2
0
        private void PlayGame(GameSetup gameSetup, TanksClient client)
        {
            bool gameFinished = false;
            while (!gameFinished)
            {
                TurnResult result = client.SubmitMove(GenerateCommand(gameSetup));

                gameFinished = result.last;
            }

            Console.WriteLine("game finished");
        }
Пример #3
0
        public virtual Command GenerateCommand(GameSetup gameSetup)
        {
            return NaiveBot.CurrentCommand;

            if (rand.NextDouble() > 0.5)
            {
                return Command.fire(rand.Next(90) - 45, rand.Next(100) + 30);
            }
            else
            {
                return Command.move(rand.NextDouble() > 0.5 ? -100 : 100);
            }
        }