Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Correction: List and ElChinito as Crafty clones, ... etc

Author: Paul H

Date: 17:41:13 08/21/04

Go up one level in this thread


Btw, here is the corresponding Crafty code (from v18.12 or older) that is the
same as the ElChinito disassembly. In the previous post, I pasted the newer
Crafty code. It still has the bug but slightly different.

If this is not proof enough, nothing will be.

// potion of Evaluat()
  if ((TotalWhitePawns+TotalBlackPawns) == 0) do {
    int ms=EvaluateMate(tree);
    if (ms == 99999) break;
    score+=ms;
    if (score>DrawScore(1) && drawn_ending==-1) return(DrawScore(wtm));
    if (score<DrawScore(1) && drawn_ending==-2) return(DrawScore(wtm));
    return((wtm) ? score : -score);
  } while(0);

// EvalauteMate()
int EvaluateMate(TREE *tree) {
  register int mate_score=DrawScore(1);
  if ((TotalBlackPieces==0) && (TotalWhitePieces==6) &&
      (!WhitePawns) && (!BlackPawns) && WhiteBishops && WhiteKnights) {
    if (dark_squares&WhiteBishops)
      mate_score=b_n_mate_dark_squares[BlackKingSQ];
    else
      mate_score=b_n_mate_light_squares[BlackKingSQ];
  }
  if ((TotalBlackPieces==6) && (TotalWhitePieces==0) &&
      (!WhitePawns) && (!BlackPawns) && BlackBishops && BlackKnights) {
    if (dark_squares&BlackBishops)
      mate_score=-b_n_mate_dark_squares[WhiteKingSQ];
    else
      mate_score=-b_n_mate_light_squares[WhiteKingSQ];
  }
  if (!mate_score) {
    if (Material >0) {
      mate_score=mate[BlackKingSQ];
      mate_score-=(Distance(WhiteKingSQ,BlackKingSQ)-3)*KING_KING_TROPISM;
    }
    else if (Material < 0) {
      mate_score=-mate[WhiteKingSQ];
      mate_score+=(Distance(WhiteKingSQ,BlackKingSQ)-3)*KING_KING_TROPISM;
    }
  }
  return(mate_score);
}



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.