Ejemplo n.º 1
0
 static void RobotMovedToDown(Robot robot, int Height)
 {
     for (int i = 0; i < Height; i++)
     {
         robot.MoveDown();
     }
 }
Ejemplo n.º 2
0
        public static void MoveOutFromDiagonalMaze(Robot robot, int width, int height)
        {
            int i = 0;

            if (width > height)
            {
                while (i < width + height - 7)
                {
                    RobotMovedToRight(robot, (width - 2) / (height - 2));
                    i += (width - 2) / (height - 2);
                    if (i >= width + height - 7)
                    {
                        break;
                    }
                    robot.MoveDown();
                    i++;
                }
            }
            else
            {
                while (i < width + height - 7)
                {
                    RobotMovedToDown(robot, (height - 2) / (width - 2));
                    i += (height - 2) / (width - 2);
                    if (i >= width + height - 7)
                    {
                        break;
                    }
                    robot.MoveRight();
                    i++;
                }
            }
        }
Ejemplo n.º 3
0
 public static void MoveOutFromEmptyMaze(Robot robot, int width, int height)
 {
     for (int i = 0; i < width - 3; ++i)
     {
         robot.MoveTo(1, 1);
     }
     robot.MoveDown();
 }