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 01:47:31 -0500 (EST)

> +  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


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