Posted by Jerry Stuckle on 02/16/07 01:16
Toby A Inkster wrote:
> Toby A Inkster wrote:
>
>> 1. You're on a particular grid square.
>> 2. Are you at the sea yet? If so, stop.
>> 3. Look at the 8 adjacent squares. Which has the lowest altitude?
>> 4. The river should flow to that square. Go to step 1.
>
> Oops! You'll sometimes run into a dead end here. I'll leave you with the
> challenge of figuring out how to detect and fix this. Clue: lakes.
>
Toby,
Nice algorithm. For your dead end, might I suggest you make the lowest
square a lake and take the next lowest square as the outlet? Repeat
until you get an outlet.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|