Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: High performance move generation

Author: Antonio Dieguez

Date: 05:23:57 11/18/99

Go up one level in this thread


On November 18, 1999 at 01:53:41, Dave Gomboc wrote:

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

hi Dave.

>What was really gained by making the code more difficult to understand?

for me, make my "friends" who descompile my java program just for curiosity a
little confused.

Also the move generator is a thing that you dont modify very much anyway, so now
you move less the scrolling bar!

>Dave

me.



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.