Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Speed up Gnuchess

10 views
Skip to first unread message

Vincent Diepeveen

unread,
Apr 18, 1994, 7:25:55 AM4/18/94
to
Hello,

I discovered in GNU-chess v 4.0 (for dos)
something that can be speeded up( i am sorry for my bad
english ), hopefully i didn't find out the speed-up as second,
however it is a little speed up, but highly effective in
Nullmove/Quiescence search, as there will be captured many
pieces over there.

In UpdatePieceList( .. ) you can see something like

UpdatePieceList( short int sq, short int iop .. ) {
short int i;
..

if( iop == 1 ) { /* remove a piece from the piecelist */
..
for( i = Pindex[ sq ] ; i < PieceCnt[ side ] ; i++ ) {
Pindex[ i ] = i;
PieceList[ side ][ i ] = PieceList[ side ][ i+1 ];
}
...
}
else {
..
..
}
}

This slow 'shifting up the array PieceList' to fill the hole
PieceList[ side ][ i ] is not practically.
It is easier and faster to say just:

..
if( iop == 1 ) {
i = Pindex[ sq ];
if( i < PieceCnt[ side ] ) {
PieceList[ side ][ i ] = PieceList[ side ][ PieceCnt[ side ] ];
Pindex[ PieceList[ side ][ i ] ] = i;
}
PieceCnt[ side ]--;
}
else {...
....

Greetings, Vincent Diepeveen.

email: vdie...@cs.ruu.nl
--
+======================================+
|| Groeten, Vincent. ||
+--------------------------------------+
|| email : vdie...@cs.ruu.nl ||

0 new messages