Beispiel #1
0
        // (TL, TL, A)
        public bool execStrategy(OpMap m, IMotionControl mc)
        {
            try
            {
                m.turnLeft();
                mc.turnLeft();

                m.turnLeft();
                mc.turnLeft();

                m.advance();
                mc.advance();
            }
            catch (CannotComplyException)
            {
                return(false);
            }
            catch (NotEnoughBatteryException)
            {
                return(false);
            }
            catch (OutOfBatteryException)
            {
                return(false);
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }
Beispiel #2
0
 public void turnLeft_facingWestTurn270_returnsWest()
 {
     map = new OpMap(m, Direction.W, 1, 1);
     map.turnLeft();
     map.turnLeft();
     map.turnLeft();
     Assert.AreEqual(map.Direction, Direction.N);
 }
Beispiel #3
0
 public void turnLeft_facingWest_returnsSouth()
 {
     map = new OpMap(m, Direction.W, 1, 1);
     map.turnLeft();
     Assert.AreEqual(map.Direction, Direction.S);
 }