Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: PATCH: rand_pos function andusage(PR#1017)
Home

[Freeciv-Dev] Re: PATCH: rand_pos function andusage(PR#1017)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH: rand_pos function andusage(PR#1017)
From: Jason Dorje Short <vze2zq63@xxxxxxxxxxx>
Date: Mon, 29 Oct 2001 15:39:14 -0500
Reply-to: jdorje@xxxxxxxxxxxx

"Ross W. Wetmore" wrote:
> 
> At 06:43 PM 01/10/28 -0500, Jason Dorje Short wrote:
> >"Ross W. Wetmore" wrote:

> [...]
> >If we make an alternate rand_pos that is topology-dependent, we can pass
> >in the range of heights that we want.  This should give us a clean
> >interface and be very fast (constant time for most topologies; some may
> >be tricky).  I dislike this method because it makes rand_pos
> >topology-dependent (which it really doesn't have to be), and doesn't
> >allow as much flexibility as the above-mentioned forms (although it is
> >sufficient for the current code's needs, and some of the above forms can
> >be used in any case).
> 
> Don't even think about it. Use rand_pos() for the generic xsize*ysize
> whole_map case, and leave all the code that selects subsets of the map
> for random positions to select as they need. Leave the responsibility
> for coding each of these cases to the code that does it, i.e. hands off.

You are opposed to replacing

  x = myrand(map.xsize);
  y = N + myrand(M);

with

  rand_pos_restricted(&x, &y, N, M);

?

> >Like I said, I really don't care what form(s) rand_pos takes.  But I
> >would like to extract the topology-dependent code from mapgen and other
> >places, and this requires making a separate function that does this.
> 
> No. Good maps are *not* topology independent, but really understand a
> lot about the characteristics of the underlying topology. The idea that
> you can somehow remove all this without totally lobotomizing the output
> is quite frankly overzealous foolishness. Anyone who thinks this way
> should not be touching this code.

The output is identical!!!

jason


[Prev in Thread] Current Thread [Next in Thread]