Exemple #1
0
        public void ChasingEachOther()
        {
            initialConfig["grid"] =
            @"________________________
            ___W_____WWWWWWWW_______
            ________________________
            ________________________
            ________________________
            ________________________
            _WWWWWWWWW______________
            ________________________
            ________________________
            _________WWWWWWWW_______
            ________________________
            ___________WWWW_________
            ________________________
            ________________________
            ________________________
            ____X__________O________";

            initialConfig["orientation"] = "west";

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Move);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }
Exemple #2
0
        public void Fire()
        {
            initialConfig["grid"] =
            @"________________________
            ___W_____WWWWWWWW_______
            ___W_W__________________
            ___W_W_______B____X_____
            ___W_W__________________
            ___W_W__________________
            _WWWWWWWWW________O_____
            _____W__________________
            _____W_WWWWW____________
            _________WWWWWWWW_______
            ________________________
            ___________WWWW_________
            ________________________
            ________________________
            ____WWW_________________
            ________________________";

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Fire);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }
Exemple #3
0
        public void DontNeedBattery()
        {
            initialConfig["grid"] =
            @"________________________
            ___W_____WWWWWWWW_______
            ___W_W_O________________
            ___W_W____________X_____
            ___W_W____________B_____
            ___W_W__________________
            _WWWWWWWWW______________
            _____W__________________
            _____W_WWWWW____________
            _________WWWWWWWW_______
            ________________________
            ___________WWWW_________
            ________________________
            ________________________
            ____WWW_________________
            ________________________";

            initialConfig["energy"] = 10;

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Move);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }
Exemple #4
0
        public void ShotInTheBack()
        {
            initialConfig["grid"] =
            @"________________________
            ___W_____WWWWWWWW_______
            ___W_W_____________L____
            ___W_W__________________
            ___W_W_____________L____
            ___W_W__________________
            _WWWWWWWWW_________X____
            _____W__________________
            _____W_WWWWW____________
            _________WWWWWWWW_______
            ________________________
            ___________WWWW_________
            ___________________O____
            ________________________
            ____WWW_________________
            ________________________";

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Right | TankAction.Left);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }
Exemple #5
0
        public void TurnRightToGetBattery()
        {
            initialConfig["grid"] =
            @"_____________________W__
            ___________WWWWWWWWWWW__
            _________B___W_B_____W__
            _____________________W__
            _____________________W__
            _WWWWWWWWWWW_________W__
            ________________________
            ________________________
            _______________W__W_____
            _______________W__W_____
            _____X____________W_____
            ___O_B____________W___L_
            __________________W_____
            __________________W_____
            ________________________
            ________________________";

            initialConfig["orientation"] = "east";

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Right);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }
Exemple #6
0
        public void OutOfEnergyGoGetBattery()
        {
            initialConfig["grid"] =
            @"________________________
            ________________W_______
            ________________W______W
            ____________W___W______W
            ________________W______W
            _______________________W
            ________________________
            ________________________
            ________WWWWWWWW________
            ________________B_______
            ________________________
            ___WWWWWWWWWWWWWW_______
            ______________________X_
            ______________________O_
            ________________________
            ________________________";

            initialConfig["energy"] = 0;

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Fire);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }
Exemple #7
0
        public void OpponentBetweenBatteryWithNoEnergy()
        {
            initialConfig["grid"] =
            @"________________________
            ___W_____WWWWWWWW_______
            ___W_W__________________
            ___W_W__________________
            ___W_W__________________
            ___W_W__________________
            _WWWWWWWWW_________X____
            _____W__________________
            _____W_WWWWW_______O____
            _________WWWWWWWW_______
            ________________________
            ___________WWWW____B____
            ________________________
            ________________________
            ____WWW_________________
            ________________________";

            initialConfig["energy"] = 0;

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Right | TankAction.Left);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }
Exemple #8
0
        public void OpponentBehindMe()
        {
            initialConfig["grid"] =
            @"________________________
            ___W_____WWWWWWWW_______
            ___W_W__________________
            ___W_W__________________
            ___W_W_____________O____
            ___W_W__________________
            _WWWWWWWWW_________X____
            _____W__________________
            _____W_WWWWW____________
            _________WWWWWWWW_______
            ________________________
            ___________WWWW_________
            ________________________
            ________________________
            ____WWW_________________
            ________________________";

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Left);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }
Exemple #9
0
        public void MultipleBatteriesWithOpponentNearOutOfEnergy()
        {
            initialConfig["grid"] =
            @"________________________
            ___W_____WWWWWWWW_______
            ___W_W_____B____________
            ___W_W____________X_____
            ___W_W____________B_____
            ___W_W__________________
            _WWWWWWWWW______________
            _____W______O___________
            _____W_WWWWW____________
            _________WWWWWWWW_______
            ________________________
            __________WWWW_________
            ________________________
            ________________________
            ____WWW_________________
            ________________________";

            initialConfig["energy"] = 0;
            initialConfig["health"] = 30;

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Move);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }
Exemple #10
0
        public void ForwardForBatteryFar()
        {
            initialConfig["grid"] =
            @"________________________
            ___W_____WWWWWWWW_______
            ___W_W__________________
            ___W_W____________X_____
            ___W_W__________________
            ___W_W__________________
            _WWWWWWWWW______________
            _____W__________________
            _____W_WWWWW____________
            _________WWWWWWWW_B_____
            ________________________
            ____O______WWWW_________
            ________________________
            ________________________
            ____WWW_________________
            ________________________";

            TestTankClient client = new TestTankClient(initialConfig, TankAction.Move);
            Game game = new Game(client);
            game.Run(new SignalWeights());
        }