In CCC a little thread about weaker engines somehow
evolved into an underpromotion problem in TSCP and
an easy fix in the source. As I have no good compiler
handy at home I thought I let you know
Best regards,
Guenther
It is easy to fix the underpromotion problem
you only need to change N B and R to small letters in the following code from tscp
Code:
- Code: Select all
int parse_move(char *s)
{
int from, to, i;
/* make sure the string looks like a move */
if (s[0] < 'a' || s[0] > 'h' ||
s[1] < '0' || s[1] > '9' ||
s[2] < 'a' || s[2] > 'h' ||
s[3] < '0' || s[3] > '9')
return -1;
from = s[0] - 'a';
from += 8 * (8 - (s[1] - '0'));
to = s[2] - 'a';
to += 8 * (8 - (s[3] - '0'));
for (i = 0; i < first_move[1]; ++i)
if (gen_dat[i].m.b.from == from && gen_dat[i].m.b.to == to) {
/* if the move is a promotion, handle the promotion piece;
assume that the promotion moves occur consecutively in
gen_dat. */
if (gen_dat[i].m.b.bits & 32)
switch (s[4]) {
case 'N':
return i;
case 'B':
return i + 1;
case 'R':
return i + 2;
default: /* assume it's a queen */
return i + 3;
}
return i;
}
/* didn't find the move */
return -1;
}
Back to top