[Freeciv-Dev] Re: [PATCH] more small directional cleanups
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, 22 Aug 2001, Ross W. Wetmore wrote:
> >It's not so much calling it when there're are no possibilities, but that you
> >depend on randomly finding one of the valid neighbors. You could guess a
> >random number 1000 times and still not find it. It seems bad to me
> >to depend on "luck" to keep your code from locking up.
>
> I'm not sure I'm concerned about the 1000 failure case. The universe is
> something like 10^30 nanoseconds old, and the probability you are worried
> about is 1 in 10^500 or so.
What if the random number generator isn't prefect?
> But would you be willing to amalgamate the flavours to something like this?
I really don't like this version at all. It's longer. You duplicate the
exact same code inside and outside the loop. The do/while loop is more
difficult to understand than the simple for loop. You have two different ways
to return, but neither one is some kind of error condition. It's not the
slightest bit faster. And you depend on the enum's having values 0-7. What
if I want them to be 1-8, and have 0 mean the center tile? I can't see any
reason to make an assumption about the numbering, it gives you nothing.
- [Freeciv-Dev] Re: [PATCH] more small directional cleanups, (continued)
[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
Message not available[Freeciv-Dev] Re: [PATCH] more small directional cleanups, Ross W. Wetmore, 2001/08/22
[Freeciv-Dev] Re: [PATCH] more small directional cleanups, Jason Dorje Short, 2001/08/22
[Freeciv-Dev] Re: [PATCH] more small directional cleanups,
Trent Piepho <=
|
|