// returns the manhattan distance between two nodes
        public int GetManhattanDistance(MazeState aState, MazeState aDest)
        {
            //Find possition of two states
            int[] aCords = aState.FindPosition();
            int[] bCords = aDest.FindPosition();

            //calculate distance - returning absolute value
            //eg aCord : (4,4)   bCord : (8, 8)
            //abs(4 - 8) + abs(4 - 8) = 8
            return(Math.Abs(aCords[0] - bCords[0]) + Math.Abs(aCords[1] - bCords[1]));
        }
        //function used to generate goal state when no already identfied in constructor
        //static function
        public static int[,] GenerateGoalState(MazeState aStartState)
        {
            //get current position so it can be changed back to traversable path
            int[] curPos = aStartState.FindPosition();
            int[,] result = MazeState.CloneState(aStartState.State);

            result[curPos[0], curPos[1]] = 1;                                                   //set curPos back to 1 (path)
            result[aStartState.State.GetLength(1) - 2, aStartState.State.GetLength(0) - 2] = 0; //set random position to goalstate

            return(result);
        }