A sector is admissible for island placement when land can be grown in
every sector within a certain distance.
place_island() picks a random start sector, then searches linearly for
an admissible sector. If it finds one, it places the island there.
Else, it reduces the distance by one and tries again. It fails when
none is found even for distance zero.
Trying with extra distance is obviously meant to reduce the risk of
islands from running into each other without need. Initial distance
is @di, the minimum distance between continents, which doesn't really
make sense, and is undocumented.
Bug: place_island() never tries the start sector.
Bias: placement probability is higher for sectors immediately
following inadmissible sectors. Because of that, islands are more
often placed to the right of existing islands. Players could exploit
that to guide their search for land.
Rewrite place_island() to pick sectors with equal probability,
dropping the undocumented extra distance feature. If it's missed, we
can bring it back.
The new code visits each sector once. The old code visits only one
sector in the best case, but each sector several times in the worst
case. fairland performance improves measurably for crowded setups
with large @di, else it suffers. For instance, Hvy Fever example
given in the commit before previous runs seven times faster for me.
With @di reduced to 2, its run time more than doubles. Not that it
matters.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>