Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map()
Home

[Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mburda@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map()
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Tue, 31 Aug 2004 07:57:21 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9799 >

> [mburda - Tue Aug 31 14:29:27 2004]:
> 
> Le mar 31/08/2004 à 16:11, Mateusz Stefek a écrit :
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=9799 >
> > 
> > > [mburda - Tue Aug 31 13:03:34 2004]:
> >  
> > +  for(i =  -1; (++i) < maxval;) {
> > 
> > there's a simpler form:
> > for (i = 0; i < maxval; i++) {
> > }
> > 
> this is a point of ( like or not like) normally all C coders can see a
> ++i with not problem, i am not a C coder! but i like it
> but if you not like it, be free to change, i am not problem!!
I understand it, but it took me few seconds to imagine a set of values
which are used by i.
Please change it.

> > 
> > +  /* apply the linearize function */
> > +  whole_map_iterate(x, y) {
> > +    hmap(x, y) = frequencies[hmap(x, y)];
> > +  } whole_map_iterate_end; 
> > 
> > Are you sure that hmap(x, y) is < maxval ?. I'm not
> > 
> yes, in the loop
> 
> whole_map_iterate(x, y) {
>    hmap(x, y) = (hmap(x, y) - min) * maxval;
>    hmap(x, y) /= max;
>    frequencies[hmap(x, y)]++;
> } whole_map_iterate_end;
> 
> this is done
but if hmap(x, y) = max ?
and min = 0

and BTW:
- hmap(x, y) /= max
+ hmap(x, y) /= (max - min)

--
mateusz



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