Author: Dave Gomboc
Date: 22:53:41 11/17/99
Go up one level in this thread
On November 17, 1999 at 10:14:45, Antonio Dieguez wrote:
>On November 16, 1999 at 14:27:37, Eugene Nalimov wrote:
>
>>Unroll the outer loop, so that iDelta[iDir] become a compile-time constant in
>>the inner loop. Also, you now have 2 calls to AddMove - replace it by one, write
>>something like that:
>>
>> for (iTarg = x+17; ONBOARD(iTarg); iTarg += 17) {
>> iTargContents = PIECE_AT(psPos, iTarg);
>> if (IS_YOUR_COLOR(iTargContents))
>> break;
>> AddMove(psPos, x, iTarg);
>> if (!IS_EMPTY(iTargContents))
>> break;
>> }
>
>for (iTarg = x+17; ONBOARD(iTarg) &&
>!IS_YOUR_COLOR(iTargContents=PIECE_AT(psPos, iTarg)); iTarg += 17) {
>
> AddMove(psPos, x, iTarg);
> if (!IS_EMPTY(iTargContents))
> break;
> }
>
>just a bir shorter.
What was really gained by making the code more difficult to understand?
Dave
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.