Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A question about the source code of crafty

Author: Robert Hyatt

Date: 10:04:42 10/15/98

Go up one level in this thread


On October 15, 1998 at 12:15:40, blass uri wrote:

>Is there an explanation for the meaning of every variable in the source code of
>crafty?
>
>I looked in evaluate.c
>I understand that the variable TotalBlackPieces is not the number of black
>pieces(otherwise always TotalBlackPieces<20 and there is no need for a command
>with if TotalBlackPieces<20 but I do not understand what is the meaning of this
>variable.
>
>It can be the value of the pieces but if this is the case than crafty cannot
>recognize a draw for insufficient material with KNNvK or KNNv KN.
>
>Uri

There really isn't such an animal, although  for those that are savvy in C,
that is a "macro" defined in chess.h... what it really is, is a material
count.  IE it starts at 39 (8*1+4*3+2*5+1*9) which is the traditional value
for the pieces.  Actually it doesn't start at 39, it starts at 37, because for
that specific variable, p=1, n=2, b=3, r=5 and q=9.  I use that so that if
the result == 4, I have two kninghts only and can't win usually...

In this case, it is a way of asking "is about 1/2 of the material gone?  If so,
the "trade-down bonus" kicks in if one side is ahead or behind.



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.