[Freeciv-Dev] Re: patch: nicer rand_neighbour()
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> Sure, but, frankly, yuck. And it doesn't allow (conveniently) using
> the myrand(5) method for y limits. Better would be a patch providing
> general macros or functions doing something similar to this. And make
#define rad2y(r) ((r)&3?((r)&4?1:-1):0)
#define rad2x(r) rad2y(((r)+2))
#define rad2by(r, y) rad2y(((((y)&&(y)!=map.ysize-1)?(r):((r)%5)))+((y)?0:4))
#define rad2bx(r, y) rad2x(((((y)&&(y)!=map.ysize-1)?(r):((r)%5)))+((y)?0:4))
Yuck! :)
Regards,
I.Q.
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com?sr=mc.mk.mcm.tag001
|
|