コード例 #1
0
        static void Main(string[] args)
        {
            RectangularGrid r = new RectangularGrid();

            Console.WriteLine(r.countRectangles(3, 3));
            Console.ReadLine();
        }
コード例 #2
0
        public static ICleanerPilot CreateCleaningRobotAt(Position startingPosition)
        {
            var grid            = RectangularGrid.MinX(-100000).MaxX(100000).MinY(-100000).MaxY(100000);
            var robot           = new RobotEngine(startingPosition);
            var restrictedRobot = new GridRestrictedRobotEngine(robot, grid);

            return(new RobotPilot(restrictedRobot));
        }
コード例 #3
0
ファイル: RectangularGrid.cs プロジェクト: chokudai/TopCoder
// END CUT HERE
// BEGIN CUT HERE
    public static void Main()
    {
        try {
            RectangularGrid ___test = new RectangularGrid();
            ___test.run_test(-1);
        } catch (Exception e) {
//Console.WriteLine(e.StackTrace);
            Console.WriteLine(e.ToString());
        }
    }
コード例 #4
0
ファイル: RectangularGrid.cs プロジェクト: chokudai/TopCoder
 // END CUT HERE
 // BEGIN CUT HERE
 public static void Main()
 {
     try {
     RectangularGrid ___test = new RectangularGrid();
     ___test.run_test(-1);
     } catch(Exception e) {
     //Console.WriteLine(e.StackTrace);
     Console.WriteLine(e.ToString());
     }
 }
コード例 #5
0
ファイル: GridTest.cs プロジェクト: diegonzls/robotwars
        public void IsValidCoordinateFalse(int x, int y)
        {
            // Arrange
            var grid = new RectangularGrid(new Location(10, 8));

            // Act
            var result = grid.IsValidLocation(new Location(x, y));

            // Assert
            Assert.IsFalse(result);
        }
コード例 #6
0
    public LimitedRectangularGrid(RectangularGrid wrapped,
                                  bool wrapX, bool wrapY,
                                  Interval allowableX, Interval allowableY)
    {
        WrapX = wrapX;
        WrapY = wrapY;

        RegionX = allowableX;
        RegionY = allowableY;

        Wrapping = wrapped;
    }
コード例 #7
0
 public void Setup()
 {
     _coordinate = new _2DCoordinate(4, 1);
     _grid       = new RectangularGrid(4, 7);
     _robot      = new SimpleMartianRobot(_coordinate, new _2DDirection(90), _grid);
 }
コード例 #8
0
 public void Setup()
 {
     _grid = new RectangularGrid(4, 7);
 }