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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH: rand_pos function and usage (PR#1017)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Oct 2001 11:12:21 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Oct 23, 2001 at 03:10:53PM -0400, Jason Dorje Short wrote:
> Raimar Falke wrote:
> > If I see this example I vote for an action part in the
> > RAND_POS_CHECKED macro. It is silly to accumulate positions and than
> > do a for loop over them. So it should possible to pass a
> > "make_forest(x, y, hmap(x, y), 25)" to the RAND_POS_CHECKED
> > macro. This would also save us the malloc/free.
> 
> Yes, it would.  It would also allow other random position generation (like
> making huts) to use this macro.
> 
> At this point, though, we see a descrepancy between the "random" method and
> the "structured" method of choosing positions, since the random method may
> happily choose the same position twice.  If we have an action element to the
> loop as well, it will have to be done within both the random and structured
> algorithms; it will no longer be possible to discard all the randomly-chosen
> points if we move to a structured algorithm.  

> So, it would make more sense IMO to separate these algorithms.

Ok as long as the interface it the same or similar.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  reality.sys corrupt. Reboot Universe? (y,n,q)


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