### What score to return from Table lookup

Posted:

**Sat Nov 27, 2010 8:53 am**I'm a bit confused as to what score I should return from a transposition table lookup. Say I have something similar to the following search and score retrieval from the table. Also, I'm saving the exact score into the table in the first place.

What score should I be returning? I've thought of a few possibilities.

Code: Select all

```
int NegaScout(int alpha, int beta, int depth)
{
. . .
. . .
TransItem *tt_item;
if (tt->getItem(board->hash(), tt_item)) {
if (tt_item->getScore(alpha, beta, depth, score))
return score;
. . .
. . .
}
. . .
. . .
}
bool getScore(int alpha, int beta, int inDepth, int &inScore)
{
if ((type & HAS_SCORE) && depth >= inDepth) {
switch (type) {
case PV_NODE:
inScore = ????;
break;
case CUT_NODE:
inScore = ????;
break;
case ALL_NODE:
inScore = ????;
break;
}
return true;
} else {
return false;
}
}
```

What score should I be returning? I've thought of a few possibilities.

ALL_NODE: score

CUT_NODE: score

PV_NODE: score

ALL_NODE: alpha

CUT_NODE: beta

PV_NODE: score

ALL_NODE: min(score, alpha)

CUT_NODE: max(beta, score)

PV_NODE: max(alpha, min(score, beta))