[Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY]
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8959 >
On Sun, 20 Jun 2004, Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8959 >
>
> Ross, you still haven't suggested a workable alternative. It is not
> sufficient to say "almost any programmer could work this one out at a
> moment's need". If you believe a better alternative is possible you
> should tell us what it is.
What Ross probably means is [skipping the flames here] if you do
adj_iterate by means of indexing into an array (as it is done now but the
ordering of the directions is a bit funny) then cart_iterate can be done
using the the same indices, but taking every second. Even if you are in
iso-mode, it is still every second (maybe starting index is different).
If you are truly hex, it's every index.
So in all cases the iterations are controlled by three parameters: start
index, increment (e.g. "every second") and stop index. These parameters
can be relatively easily selected.
[I'm skipping some more flames here]
My opinion is that the pressure on the brains of present and future coders
might be too much for the benefit accrued. As a compromise, I can suggest
implementing cart_iterate not as
adj_iterate() {
if (not_cartesian) skip;
but as an exact copy of adj_iterate code with "if (not_cartesian) skip"
done right after "for()". Instruction-wise this would be half-way
between the above and the perfect solution.
If the ordering of the directions is changed to rotational, the test for
cardinal-ness is just a test for even-ness (or odd-ness).
G.
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], rwetmore@xxxxxxxxxxxx, 2004/06/11
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/11
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], rwetmore@xxxxxxxxxxxx, 2004/06/13
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/13
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/20
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY],
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], rwetmore@xxxxxxxxxxxx, 2004/06/20
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/21
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Gregory Berkolaiko, 2004/06/22
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/22
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/22
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], rwetmore@xxxxxxxxxxxx, 2004/06/23
- [Freeciv-Dev] (PR#8959) remove CAR_DIR_D[XY], Marcelo Burda, 2004/06/30
|
|