[Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map()
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<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
- [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map(), (continued)
- [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map(), Marcelo Burda, 2004/08/27
- [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map(), Marcelo Burda, 2004/08/31
- [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map(), Mateusz Stefek, 2004/08/31
- [Freeciv-Dev] Re: (PR#9799) PATCH: rewrited adjust_map(), Marcelo Burda, 2004/08/31
- [Freeciv-Dev] Re: (PR#9799) PATCH: rewrited adjust_map(), Jason Short, 2004/08/31
- [Freeciv-Dev] Re: (PR#9799) PATCH: rewrited adjust_map(), Jason Short, 2004/08/31
- [Freeciv-Dev] Re: (PR#9799) PATCH: rewrited adjust_map(), Jason Short, 2004/08/31
- [Freeciv-Dev] Re: (PR#9799) PATCH: rewrited adjust_map(), Marcelo Burda, 2004/08/31
- [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map(), Mateusz Stefek, 2004/08/31
- [Freeciv-Dev] Re: (PR#9799) PATCH: rewrited adjust_map(), Marcelo Burda, 2004/08/31
- [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map(),
Mateusz Stefek <=
- [Freeciv-Dev] Re: (PR#9799) PATCH: rewrited adjust_map(), Marcelo Burda, 2004/08/31
- [Freeciv-Dev] Re: (PR#9799) PATCH: rewrited adjust_map(), Jason Short, 2004/08/31
- [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map(), Mateusz Stefek, 2004/08/31
- [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map(), Mateusz Stefek, 2004/08/31
- [Freeciv-Dev] Re: (PR#9799) PATCH: rewrited adjust_map(), Jason Short, 2004/08/31
- [Freeciv-Dev] (PR#9799) PATCH: rewrited adjust_map(), Mateusz Stefek, 2004/08/31
|
|