* FILE: eval.c
*
* ----------------------------------------------------------------------
- *
- * Copyright (c) 2012 Free Software Foundation
+ * Copyright (c) 1993, 1994, 1995 Matthias Mutz
+ * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
*
* GNU SHOGI is based on GNU CHESS
*
+ * Copyright (c) 1988, 1989, 1990 John Stanback
+ * Copyright (c) 1992 Free Software Foundation
+ *
* This file is part of GNU SHOGI.
*
* GNU Shogi is free software; you can redistribute it and/or modify it
static long *atk1, *atk2;
static long a1, a2;
-#define csquare(side, sq) ((side == black) ? sq : (NO_SQUARES_1 - sq))
+#define csquare(side, sq) ((side == black) ? sq : (NO_SQUARES - 1 - sq))
#define crow(side, sq) row(csquare(side, sq))
#define ccolumn(side, sq) column(csquare(side, sq))
{
short sq;
- for (sq = c; sq < NO_SQUARES; sq += 9)
+ for (sq = c; sq < NO_SQUARES; sq += NO_COLS)
{
if (on_csquare(side, piece, sq))
return true;
{ \
if (color[u] != c2) \
{ \
- if ((atk1[u] == 0) || ((atk2[u] & CNT_MASK) > 1)) \
+ if ((atk1[u] == 0) || ((atk2[u] & CNT_MASK) != 0)) \
{ \
++cnt; \
} \
PromotionZoneDistanceValue(sq, 3);
/* pawn mobility */
- if (color[(c1 == black) ? (sq + 9) : (sq - 9)] == neutral)
+ if (color[(c1 == black) ? (sq + NO_COLS) : (sq - NO_COLS)] == neutral)
{
s += (ds = MBLTY[pawn]);
}
{
if (crow(c1, sq) == 2) /* pawn on 3d rank */
{
- if (board[(c1 == black) ? (sq + 27) : (sq - 27)] == pawn)
+ if (board[(c1 == black) ?
+ (sq + 3*NO_COLS) : (sq - 3*NO_COLS)] == pawn)
{
/* opposing pawn has been moved (even column == (sq & 1)) */