Exemplo n.º 1
0
    public static void Main(string[] args)
    {
        // robot a = new robot("/Users/shaunlee/Documents/GitHub/temp/P3/grid.txt",1);

        // string text = System.IO.File.ReadAllText("grid.txt");
        // string ss = text.Replace("\n", " ");
        // ss = string.Join( " ", ss.Split( new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries ));
        // string[] arr = ss.Split(' ');
        // for(int i = 0; i < arr.Length; i++)
        // {
        //     Console.WriteLine(arr[i]);
        // }
        robot a = new robot("grid.txt", 1);

        a.Move(0);
        a.Move(3);
        Console.WriteLine(a.getColumn() + " " + a.getRow());
    }
Exemplo n.º 2
0
 public static void testRobot(robot obj)
 {
     printRobotCoord(obj);
     Console.WriteLine("used moveone()");
     obj.MoveOne();
     printRobotCoord(obj);
     obj.Move();
     Console.WriteLine("used move()");
     printRobotCoord(obj);
 }
Exemplo n.º 3
0
 /*
  * PreCondition:none
  * PostCondition: uses move() the robot depending on the type of robot robotObj is
  */
 public void Move()
 {
     robotObj.Move();
     Check();
 }