
-----------------------------------
MysticVegeta
Tue Nov 08, 2005 7:51 pm

Count Shapes (II) Recursion problem!
-----------------------------------
Hello, I have been trying to code the DWITE problem from November 2003, its called Count Shapes (II).  Rules:

An input text file contains a rectangular arrangement of dots and X's. The X's form shapes that are separated by space. The
dots (periods) represent empty space which separate one shape from another. It is your task to count the number of shapes in
the rectangle, the size of the largest shape in the rectangle, and the size of the smallest shape in the rectangle. For the purpose
of defining a shape, please note that any given X belongs to the same shape as any other X that is its neighbour above, below,
to its left and to its right. Any two X's on a diagonal are not connected. In the rectangle below, in data set 1, there are 6
discrete shapes: two of these are touching diagonally and two shapes are positioned one inside the other.

The input file (DATA3) will contain five sets of data. Each set of data will be made up of two lines containing integers and
then the rectangle itself. The first integer, w, represents the width of the rectangle (length of each line) and the second
integer, h, represents the height of the rectangle to be examined (number of lines). 1 