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()); }
public SubRobot(int robotnum, string file, int numberofGrids) { this.numberofGrids = numberofGrids; if (robotnum == 0) { robotObj = new robot(file); } else if (robotnum == 1) { robotObj = new RotatingRobot(file); } else { robotObj = new TranRobot(file); } subObj = new submersible(numberofGrids); rCoord = robotObj.getRow(); cCoord = robotObj.getColumn(); }
public static void printRobotCoord(robot obj) { Console.WriteLine("row:{0} Column:{1}", obj.getRow(), obj.getColumn()); }