Computer Chess Club Archives


Search

Terms

Messages

Subject: How to compare the current_material with the root_material?

Author: Alvaro Jose Povoa Cardoso

Date: 15:34:42 05/14/05


Hi,
I want to compare the current material with the root material to see if I can
make an extention or a reduction.
Suppose that I have two variables: root_material wich is global, and
current_material wich is local to the search() function.
root_material is computed after making a move at the root and setting
current_move(root ply) and before calling search().
The root ply = 1.

Now, I do I setup a current_material variable at the current ply so that I can
compare the two?

In search() wich is correct?

int current_material, root_mat;
makemove(wtm, ply)
  current_material=ComputeMaterialScore(); root_mat=root_material;
  if (wtm==0) {current_material=-current_material; root_mat=-root_mat};
unmakemove(wtm, ply)

   OR

int current_material, root_mat;
makemove(wtm, ply)
  current_material=ComputeMaterialScore(); root_mat=root_material;
  if ((ply & 1)==0) {current_material=-current_material; root_mat=-root_mat};
unmakemove(wtm, ply)


so that I can do:

if (current_material < root_mat) {reduce depth};
if (current_material > root_mat) {extend depth};

Best regards,
Alvaro Cardoso











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.