Article View: gnu.chess
Article #5144Re: more pl68 woes ScoreK1PK
From: Roger Uzun
Date: Mon, 21 Feb 1994 19:41
Date: Mon, 21 Feb 1994 19:41
79 lines
2612 bytes
2612 bytes
Here is K1PK with conditional compilation for the 4PL64 kind
of way and the other. I have 2 questions:
Shoudl we use the EETable to put values in and get values
out for K1pk??
Also should we modify the return score by the distance
functions as the #ifdef WAY4PL64 does below, or should
we do it the 4PL68 way (alternate code below)
======ScoreK1PK which version is best???=====
inline
int
ScoreK1PK (short side,
short winner,
short loser,
short king1,
register short king2,
register short sq)
/*
* We call Don Beal's routine with the necessary parameters and determine
* win/draw/loss. Then we compute the real evaluation which is +-500 for
* a win/loss and 10 for a draw, plus some points to lead the computer to
* a decisive winning/drawing line.
*/
{
#ifdef WAY4PL64
short s;
#endif
short win, sqc, sqr, k1c, k1r, k2c, k2r;
const int drawn = 10, won = 500;
#ifdef WAY4PL64
#ifdef CACHE
if (ProbeEETable(side,&s)) return s;
#endif
#endif
sqc = column (sq) + 1;
sqr = row (sq) + 1;
k1c = column (king1) + 1;
k1r = row (king1) + 1;
k2c = column (king2) + 1;
k2r = row (king2) + 1;
if (winner == black)
{
sqr = 9 - sqr;
k1r = 9 - k1r;
k2r = 9 - k2r;
}
if (sqc > 4)
{
sqc = 9 - sqc;
k1c = 9 - k1c;
k2c = 9 - k2c;
}
if (side == winner)
win = kpkwv_ (sqc, sqr, k1c, k1r, k2c, k2r);
else
win = kpkbv_ (sqc, sqr, k1c, k1r, k2c, k2r);
#ifdef WAY4PL64
if (!win) s = drawn + 5 * distance (sq, king2) - 5*distance(king1,king2);
else s = won + 50 * (sqr - 2) + 10*distance(sq,king2);
#else
if (!win)
return drawn + 5 * distance (sq, king2);
else
return won + 50 * (sqr - 2);
#endif
#ifdef WAY4PL64
#ifdef CACHE
if (PUTVAR) PutInEETable (side, s);
#endif
return s;
#endif
}
Technical Details
Message-ID:
<CLLApJ.Fqn@crash.cts.com>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!news.intercon.com!udel!news.sprintlink.net!crash!uzunReferences:
<1994Feb20.112421.712@ark.btbg.sub.de> <CLKH40.JsC@crash.cts.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d71d,dc4e1ea8fd38faf0 X-Google-Attributes: gid10d71d,public X-Google-ArrivalTime: 1994-02-21 11:41:41 PST Newsgroups: gnu.chess Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!news.intercon.com!udel!news.sprintlink.net!crash!uzun From: uzun@crash.cts.com (Roger Uzun) Subject: Re: more pl68 woes ScoreK1PK Organization: CTS Network Services (CTSNET/crash), San Diego, CA Date: Mon, 21 Feb 1994 19:41:41 GMT Message-ID: <CLLApJ.Fqn@crash.cts.com> References: <1994Feb20.112421.712@ark.btbg.sub.de> <CLKH40.JsC@crash.cts.com> Sender: news@crash.cts.com (news subsystem) Nntp-Posting-Host: crash.cts.com Lines: 81