* FILE: init.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
/*
- * nextpos[piece][from-square], nextdir[piece][from-square] gives vector
- * of positions reachable from from-square in ppos with piece such that the
+ * nextpos[ptype][from-square], nextdir[ptype][from-square] gives vector
+ * of positions reachable from from-square in ppos with ptype such that the
* sequence
*
- * ppos = nextpos[piece][from-square];
- * pdir = nextdir[piece][from-square];
+ * ppos = nextpos[ptype][from-square];
+ * pdir = nextdir[ptype][from-square];
* u = ppos[sq];
*
* do
small_short diagonal(short d)
{
- return (abs(d) == 10 || abs(d) == 12);
+ return (abs(d) == (NO_COLS+1) || abs(d) == (NO_COLS+3));
}
short dest[8][9];
short sorted[9];
short steps[8];
- short fpo = 23, tpo = 120;
+ short fpo = inunmap[0], tpo = 1 + inunmap[NO_SQUARES-1];
+ /* pre-fill nextpos and nextdir with source position, probably so
+ * (color[u] == neutral) stops to match once all moves have been seen
+ */
for (ptyp = 0; ptyp < NO_PTYPE_PIECES; ptyp++)
{
for (po = 0; po < NO_SQUARES; po++)
if (XSHOGI)
{
- signal(SIGUSR1, TerminateSearch);
-
TCmoves = 40;
TCminutes = 5;
TCseconds = 0;