Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8632) Easy way to set map size with auto ratios (s
Home

[Freeciv-Dev] Re: (PR#8632) Easy way to set map size with auto ratios (s

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8632) Easy way to set map size with auto ratios (seteables if desired)
From: "Marcelo Burda" <mburda@xxxxxxxxx>
Date: Wed, 26 May 2004 23:06:20 -0700
Reply-to: rt@xxxxxxxxxxx

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

Le jeu 27/05/2004 à 07:28, Jason Short a écrit :
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8632 >
> 
> Your mcd (maximum common denominator?
yes
> ) function isn't good.
> 
> - I've always seen it called gcf, greatest common factor. 
> http://www.math.com/school/subject1/lessons/S1U3L2GL.html.  But gcd
> would also be okay.
> 
> - According to Euclid's Algorithm (Euclidean algorithm):
> 
> gcf(a, b) = gfc(b, a-b)
> gcf(a, 0) = a.
> 
> which gives:
> 
> int gcf(int a, int b)
> {
>   int min = MIN(a, b), max = MAX(a, b);
> 
>   if (min == 0) return max;
>   return gcf(min, max - min);
> }
> 
thx, i am physician, i not kown all algorithms.
(and i was not search for ;-) )
if gcf is more known in english than mcd we will get it, 
>  Also...
> 
> INIT_TOPOLOGY_CASE shouldn't be a macro.  In fact you don't need a
> switch statement here at all.  Make the list of default values an array
> and just give something like
> 
>   if (map.ratio == 100) {
>     set_ratio(default_ratio[map.topology_id]);
>   } else {
>     set_ratio(map.ratio);
>   }
> 
> Which brings me to my next point that auto_ratio and user_ratio should
> be merged.
> 
ok
> I haven't delved too deep into set_mapratio yet though.

> jason
-- 
 . /  .     '    ,    .      (*)   '        `     '      `    .    
  |    ,  |   `     ,     .      ,   '  Marcelo Julián Burda      .
 /  '     \     `     \@_     '      .        '      `        '    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




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