X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Fgenmove.c;h=9034b659682adb6aa65ebf0743735f668241165b;hb=f92bdd9f1749d7d6d0b37c1f3870e58a98d1e142;hp=3003b5a1b1c24896656c409e4b63141bf4c0c1cc;hpb=5fbd58dc91d27467d3ccbea2d76ab70a5ff2b3f7;p=gnushogi.git diff --git a/gnushogi/genmove.c b/gnushogi/genmove.c index 3003b5a..9034b65 100644 --- a/gnushogi/genmove.c +++ b/gnushogi/genmove.c @@ -2,11 +2,14 @@ * FILE: genmove.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 @@ -323,8 +326,10 @@ PromotionPossible(short color, short f, short t, short p) switch (p) { case pawn: +#ifndef MINISHOGI case lance: case knight: +#endif case silver: case bishop: case rook: @@ -355,6 +360,7 @@ NonPromotionPossible(short color, short f, : (generate_move_flags ? ILLEGAL_TRAPPED : false)); } +#ifndef MINISHOGI case lance: if (color == black) { @@ -382,6 +388,7 @@ NonPromotionPossible(short color, short f, ? true : (generate_move_flags ? ILLEGAL_TRAPPED : false)); } +#endif } return true; @@ -530,7 +537,11 @@ field_bonus(short ply, short side, short piece, /* CHECKME: is this right? */ if (((rvupiece == rvuboard) && (upiece == pawn)) - || (upiece == bishop) || (upiece == knight)) + || (upiece == bishop) +#ifndef MINISHOGI + || (upiece == knight) +#endif + ) { s++; /* The opposing pawn (piece) */ @@ -769,7 +780,11 @@ LinkMove(short ply, short f, { #ifdef TESUJIBONUS /* Look at non-promoting silver or knight */ - if (piece == silver || piece == knight) + if (piece == silver +#ifndef MINISHOGI + || piece == knight +#endif + ) { local_flag |= tesuji; /* Non-promotion */ s++; @@ -905,6 +920,7 @@ DropPossible(short piece, short side, short sq) GenUnmakeMove(side, f, sq, tempb, tempc, false); } } +#ifndef MINISHOGI else if (piece == lance) { if ((side == black) && (r == 8)) @@ -919,6 +935,7 @@ DropPossible(short piece, short side, short sq) else if ((side == white) && (r <= 1)) possible = (generate_move_flags ? ILLEGAL_TRAPPED : false); } +#endif return possible; } @@ -1107,9 +1124,13 @@ LinkPreventCheckDrops(short side, short xside, short ply) if (board[square = PieceList[side][0]] != king) return; - for (piece = lance; piece <= rook; piece++) /* FIXME */ + for (piece = pawn+1; piece <= rook; piece++) { - if (piece == lance || piece == bishop || piece == rook) + if ( +#ifndef MINISHOGI + piece == lance || +#endif + piece == bishop || piece == rook) { /* check for threat of xside piece */ ptyp = ptype[side][piece]; @@ -1636,7 +1657,7 @@ IsCheckmate(short side, short in_check, short blockable) * Drops are restricted for pawns, lances, and knights. */ - if (piece > knight) + if (piece >= silver) break; } }