[Freeciv-Dev] Re: patch: nicer rand_neighbour()
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> + int xoff[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
> + int yoff[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
I believe these arrays appear more than thrice in the entire freeciv source
To not using such arrays:
int dr=myrand(8);
if(dr&3)
*x += dr&4 ? 1 : -1;
dr+=2;
if(dr&3)
*y += dr&4 ? 1 : -1;
Regards,
I.Q.
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com?sr=mc.mk.mcm.tag001
- [Freeciv-Dev] Re: patch: nicer rand_neighbour(),
½²«íµØ <=
|
|