X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Feval.c;h=cbae96804230327b20852fc8cf35f0ac769cec54;hb=e6d0e922c94c9999f1f8a803af008e0a482bedf0;hp=391cdb89533c21bec37adc5fb235dd862f8b9cf8;hpb=c39fb1a68b51ce883759aff86ac93643ccd6d902;p=gnushogi.git diff --git a/gnushogi/eval.c b/gnushogi/eval.c index 391cdb8..cbae968 100644 --- a/gnushogi/eval.c +++ b/gnushogi/eval.c @@ -4,6 +4,7 @@ * ---------------------------------------------------------------------- * Copyright (c) 1993, 1994, 1995 Matthias Mutz * Copyright (c) 1999 Michael Vanier and the Free Software Foundation + * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation * * GNU SHOGI is based on GNU CHESS * @@ -1354,6 +1355,12 @@ PawnValue(short sq, short side) if (in_opening_stage) { +#ifndef MINISHOGI +/* FIXME: [HGM] The 3rd-rank Pawn section is meaningless in mini-Shogi, + * (which does not have opposing Pawns), and can do out-of-bound access, + * as the promotion zone is only 1 rank, so Pawns can be closer than 3 ranks + * to the board edge. + */ if (crow(c1, sq) == 2) /* pawn on 3d rank */ { if (board[(c1 == black) ? @@ -1383,6 +1390,9 @@ PawnValue(short sq, short side) } } +/* FIXME: calculations below are wrong for minishogi, all done for 9x9 + * board - and anyway we don't know the stage really :) + */ if ((GameType[c1] == STATIC_ROOK) && (sq == csquare(c1, 43))) { if ((atk2[csquare(c1, 52)] & CNT_MASK) < 2) @@ -1404,6 +1414,7 @@ PawnValue(short sq, short side) s += (ds = -2 * fv1[ATTACKED]); } } +#endif } return s; @@ -1497,6 +1508,10 @@ SilverValue(short sq, short side) if (in_opening_stage) { +#ifndef MINISHOGI +/* FIXME: calculations below are wrong for minishogi, all done for 9x9 + * board - and anyway we don't know the stage really :) + */ if (GameType[c1] == STATIC_ROOK) { if (csquare(c1, sq) == 12) @@ -1510,6 +1525,7 @@ SilverValue(short sq, short side) } } } +#endif } else { @@ -1540,6 +1556,10 @@ GoldValue(short sq, short side) if (in_opening_stage) { +#ifndef MINISHOGI +/* FIXME: calculations below are wrong for minishogi, all done for 9x9 + * board - and anyway we don't know the stage really :) + */ if ((GameType[c1] == STATIC_ROOK) && (GameType[c2] != STATIC_ROOK)) { if (Mvboard[csquare(c1, 3)]) @@ -1547,6 +1567,7 @@ GoldValue(short sq, short side) s += (ds = -2 * fv1[OPENWRONG]); } } +#endif } else { @@ -1569,6 +1590,10 @@ BishopValue(short sq, short side) if (in_opening_stage) { +#ifndef MINISHOGI +/* FIXME: calculations below are wrong for minishogi, all done for 9x9 + * board - and anyway we don't know the stage really :) + */ if (GameType[c1] == RANGING_ROOK) { /* Bishops diagonal should not be open */ @@ -1590,6 +1615,7 @@ BishopValue(short sq, short side) s += (ds = -fv1[OPENWRONG]); } } +#endif } else { @@ -1614,6 +1640,10 @@ RookValue(short sq, short side) if (in_opening_stage) { +#ifndef MINISHOGI +/* FIXME: calculations below are wrong for minishogi, all done for 9x9 + * board - and anyway we don't know the stage really :) + */ short WRONG = fv1[OPENWRONG], OPOK = WRONG / 3; if (GameType[c1] == STATIC_ROOK) @@ -1672,6 +1702,7 @@ RookValue(short sq, short side) } } } +#endif } else { @@ -1795,6 +1826,10 @@ KingValue(short sq, short side) if (fv1[KSFTY] != 0) s += KingScan(sq); +#ifndef MINISHOGI +/* FIXME: calculations below are wrong for minishogi, all done for 9x9 + * board - and anyway we don't know the stage really :) + */ if (in_opening_stage) { if ((GameType[c1] != UNKNOWN) && (ccolumn(c1, sq) == 4)) @@ -1810,6 +1845,7 @@ KingValue(short sq, short side) s += (ds = -fv1[OPENWRONG] / 2); } } +#endif /* CHECKME: is this correct? */ if ((ds = fv1[HOPN])) @@ -2544,6 +2580,7 @@ ExaminePosition(short side) +/* FIXME: calculations below are wrong for minishogi, all done for 9x9 */ void DetermineStage(short side) {