public bool IsCoordinateOnPath(Coordinates cordinates)
        {
            foreach (var internalCords in _Coordinates)
              {
            if (cordinates == internalCords)
            {
              return true;
            }
              }

              return false;
        }
        private Coordinates[] GenerateNewValidCoordinates(Coordinates coordinate, CoordinatePath coordinatePath)
        {
            List<Coordinates> validCoordiantes = new List<Coordinates>();
              Coordinates[] newCordinates = GetNewValidCoordinates(coordinate);
              foreach (var coord in newCordinates)
              {

            if (!IsCoordinateAlreadyVisitedOnPath(coord, coordinatePath))
            {
              validCoordiantes.Add(coord);
            }
              }
              if (validCoordiantes.Count() != 0)
              {
            return validCoordiantes.ToArray();
              }
              else
              {
            return null;
              }
        }
        private Coordinates[] GetNewValidCoordinates(Coordinates origionalCoordinates)
        {
            int x = origionalCoordinates.XCoordinate;
              int y = origionalCoordinates.YCoordinate;

              Coordinates[] additionCoordinates = new Coordinates[]
              {
            new Coordinates(-2,1),
            new Coordinates(-1,2),
            new Coordinates(1,2),
            new Coordinates(2,1),
            new Coordinates(2,-1),
            new Coordinates(1,-2),
            new Coordinates(-1,-2),
            new Coordinates(-2,-1)
              };

              List<Coordinates> newCoordinates = new List<Coordinates>();
              foreach (var coordinateAddtion in additionCoordinates)
              {
            Coordinates newCoordinate = origionalCoordinates + coordinateAddtion;
            if (ValidateCoordinates(newCoordinate))
            {
              newCoordinates.Add(newCoordinate);
            }
              }
              return newCoordinates.ToArray();
        }
 private void AddCoordinateVisitOnPath(Coordinates coordinate, CoordinatePath coordinatePath)
 {
     coordinatePath.AddCoordinate(coordinate);
 }
        private bool ValidateCoordinates(Coordinates coordinates)
        {
            if (coordinates.XCoordinate < 0 || coordinates.XCoordinate > _SquareSize - 1)
              {
            return false;
              }

              else if (coordinates.YCoordinate < 0 || coordinates.YCoordinate > _SquareSize - 1)
              {
            return false;
              }
              else
              {
            return true;
              }
        }
        private void RecursivePaths(Coordinates coordinate,CoordinatePath coordinatePath)
        {
            if (IsCoordinateAlreadyVisitedOnPath(coordinate, coordinatePath))
              {
            return;
              }

              AddCoordinateVisitOnPath(coordinate, coordinatePath);

              Coordinates[] newCoordinates = GenerateNewValidCoordinates(coordinate, coordinatePath);

              if (newCoordinates == null)
              {
            return;
              }

              Console.WriteLine("number of choices is" + newCoordinates.Length.ToString());
              CoordinatePath tmp =  coordinatePath.Branch();
              for (int i = 0; i < newCoordinates.Length; i++)
            {
            if (i == 1)
            {
            }

            //this is the first one
            CoordinatePath cordinatePathToPassOn;
            if (i == 0)
            {
              cordinatePathToPassOn = coordinatePath;
            }
            else
            {
              CoordinatePath path = tmp.Branch();
              _CoordinatePaths.Add(path);
              cordinatePathToPassOn = path;
            }

            RecursivePaths(newCoordinates[i], cordinatePathToPassOn);
              }
        }
 private bool IsCoordinateAlreadyVisitedOnPath(Coordinates coordiante, CoordinatePath coordinatePath)
 {
     if (coordinatePath.IsCoordinateOnPath(coordiante))
     return true;
       else
     return false;
 }
 public void AddCoordinate(Coordinates coordinates)
 {
     _Coordinates.Add(coordinates);
 }