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: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH: rand_pos function and usage (PR#1017)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 Oct 2001 00:36:56 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Oct 28, 2001 at 04:48:24PM -0400, Ross W. Wetmore wrote:
> At 11:12 AM 01/10/24 +0200, Raimar Falke wrote:
> >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.
> 
> Again, most of the time the constraints on positions to randomize mean
> that this approach is useless or unwieldy. You need a constraint function
> to check, and a process function if the check succeeds.

> It is usually simpler to just leave the logic in the code flow the way
> it is, and not try to invert it in wierd ways to get the rand() function
> extracted.

Yes this may possible.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "The very concept of PNP is a lovely dream that simply does not translate to
  reality. The confusion of manually doing stuff is nothing compared to the
  confusion of computers trying to do stuff and getting it wrong, which they
  gleefully do with great enthusiasm." 
    -- Jinx Tigr in the SDM


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