[Freeciv-Dev] Re: [PATCH] more small directional cleanups
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
>
> On Tue, Aug 21, 2001 at 11:40:17PM -0400, Jason Dorje Short wrote:
> > Better because it's in the "default" case or better because it returns
> > "Bad Direction"? The second is good, the first one I find less legible.
>
> You have programmed the same as a default case but didn't put it into
> the switch statement where a programmer will expect it.
For me, it's more legible at the end...it's easier for me to see the
flow of the program.
> > + int dirs[8] = {0, 1, 2, 3, 4, 5, 6, 7}; /* list of all 8 directions */
>
> You introduce new magic numbers?
They're not magic; all they assume about the directional system is that
the directions go 0-7 (which is also implied by DIR_DX/DIR_DY arrays).
The order is irrelevant since they're just used for the random lookup.
Both are fine either way IMO. Thanks for applying it :-)
jason
[Freeciv-Dev] Re: [PATCH] more small directional cleanups, Jason Dorje Short, 2001/08/20
- [Freeciv-Dev] Re: [PATCH] more small directional cleanups, Trent Piepho, 2001/08/20
- [Freeciv-Dev] Re: [PATCH] more small directional cleanups, Raimar Falke, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] more small directional cleanups, Jason Dorje Short, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] more small directional cleanups, Raimar Falke, 2001/08/22
- [Freeciv-Dev] Re: [PATCH] more small directional cleanups,
Jason Dorje Short <=
- [Freeciv-Dev] Re: [PATCH] more small directional cleanups, Trent Piepho, 2001/08/22
- [Freeciv-Dev] Re: [PATCH] more small directional cleanups, Raimar Falke, 2001/08/22
Message not available[Freeciv-Dev] Re: [PATCH] more small directional cleanups, Ross W. Wetmore, 2001/08/20
[Freeciv-Dev] Re: [PATCH] more small directional cleanups, Ross W. Wetmore, 2001/08/20
[Freeciv-Dev] Re: [PATCH] more small directional cleanups, Trent Piepho, 2001/08/22
|
|