public static int[] FindNextDeadendRight(int[] startingCoordinates) //returns map coordinates of next dead-end cell to the right { int[] rValue = startingCoordinates; if (CanMoveRight(rValue)) { return(FindNextDeadendRight(MapUtility.GetNext(rValue, (int)Directions.Right))); } else { return(rValue); } }
public static int[] FindNextDeadendUp(int[] startingCoordinates) //returns map coordinates of next dead-end cell to the above { int[] rValue = startingCoordinates; if (CanMoveUp(rValue)) { rValue = MapUtility.GetNext(rValue, (int)Directions.Up); return(FindNextDeadendUp(rValue)); } else { return(rValue); } }
public static int[] FindNextDeadendDown(int[] startingCoordinates) //returns map coordinates of next dead-end cell below { int[] rValue = startingCoordinates; if (CanMoveDown(rValue)) { rValue = MapUtility.GetNext(rValue, (int)Directions.Down); return(FindNextDeadendDown(rValue)); } else { return(rValue); } }