Ah, right! Sorry, I misunderstood.

Yeah, you're absolutely right. Counting connected land tiles would be
really hard to do just using loops. I remember using a similar
recursive algorithm to this one when writing a Minesweeper game :)

Sorry, I thought it was just counting all land tiles.

On 3 November 2011 21:59, Gunther Diemant <g.diemant / gmx.net> wrote:
> 2011/11/2 Sam Rose <samwho / lbak.co.uk>:
>> Recursion is a really great tool for problems like this :) I think the
>> example is a little bit contrived, though. Counting the land tiles is
>> nothing that a simple loop or two couldn't solve. However, I suppose
>> he is trying to illustrate a point.
>
> I think its not about counting all land tiles, instead it counts
> connected land tiles (containing the start point).
> This problem isn't so easy to solve with a simple loop.
>
>