bug-gnu-chess
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ScoreDev()


From: chess
Subject: ScoreDev()
Date: Sat, 12 Jul 2003 23:31:43 -0500

Hello All.

Here are some optimizations / corrections to ScoreDev():
int s is initialized only once.
xside is removed.
Comment is corrected.
GameCnt calculation is simplified.
flankfile and centerfile bitmaps are constants.

<    int s = 0;
<    int xside;
---
>    int s;
>    //   int xside;
1222c1217
<    xside = 1 ^ side;
---
>    //   xside = 1 ^ side;
1226c1221
<    s += nbits(c) * -8;
---
>    s = nbits(c) * -8;
1228,1229c1223,1224
<    /* If we are castled or beyond the 10th move, no more ScoreDev */
<    if (board.castled[side] || GameCnt/2+1 >= 20)
---
>    /* If we are castled or beyond the 20th move, no more ScoreDev */
>    if (board.castled[side] || GameCnt >= 38)
1267c1262
<    c = board.b[side][pawn] & (FileBit[0]|FileBit[1]|FileBit[6]|FileBit[7]);
---
>    c = board.b[side][pawn] & ULL(0xc3c3c3c3c3c3c3c3);
1276c1271
<    c = board.b[side][pawn] & (FileBit[2]|FileBit[3]|FileBit[4]|FileBit[5]);
---
>    c = board.b[side][pawn] & ULL(0x3c3c3c3c3c3c3c3c);

*Mike





reply via email to

[Prev in Thread] Current Thread [Next in Thread]