Do you understand the reason for the following code in Toga

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Do you understand the reason for the following code in Toga

Postby Uri Blass » 08 Aug 2005, 11:28

code in Toge1.0 beta2:

if (op[colour] >= -22) // Thomas king safe?
op[colour] -= (attack_tot * KingAttackOpening * KingAttackWeight[piece_nb]) / 256;
else
op[colour] -= ((attack_tot * KingAttackOpening * KingAttackWeight[piece_nb]) / 256) * 1;


It seems to me that
op[colour] -= (attack_tot * KingAttackOpening * KingAttackWeight[piece_nb]) / 256; from fruit's code has the same effect and I do not understand the reason for the change from fruit's code.

Uri
User avatar
Uri Blass
 
Posts: 727
Joined: 09 Oct 2004, 05:59
Location: Tel-Aviv

Re: Do you understand the reason for the following code in T

Postby Roman Hartmann » 08 Aug 2005, 12:36

That looks really a bit odd. Seems to me that there is no need for the if/else statement ...

Roman
User avatar
Roman Hartmann
 
Posts: 155
Joined: 11 Oct 2004, 14:21

Re: Do you understand the reason for the following code in T

Postby Tord Romstad » 08 Aug 2005, 12:41

Uri Blass wrote:code in Toge1.0 beta2:

if (op[colour] >= -22) // Thomas king safe?
op[colour] -= (attack_tot * KingAttackOpening * KingAttackWeight[piece_nb]) / 256;
else
op[colour] -= ((attack_tot * KingAttackOpening * KingAttackWeight[piece_nb]) / 256) * 1;

I often have similar code in my engine (but usually only in private development versions, I try to remove it before a public release). Thomas is probably experimenting with various factors different from 1, but because of lack of testing or something similar he has decided to be conservative and use a factor of 1 in the public version.

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 25 guests