Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2000:
[Freeciv-Dev] Re: patch: nicer rand_neighbour()
Home

[Freeciv-Dev] Re: patch: nicer rand_neighbour()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: patch: nicer rand_neighbour()
From: ½²«íµØ <iquin@xxxxxxxxxx>
Date: Mon, 24 Jan 2000 23:08:46 -0500 (EST)

> 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


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