X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Finit.c;h=7b9663b24356353ad3c0d0673e21eadd903f0052;hb=6cdb4afe21c8d0eb740a6a22a02a0adf922fddfc;hp=6e4cfcedf785318e614965c2708683dec7313c0e;hpb=82b026e6376b640a4d3409a461dd6bd83708e33e;p=gnushogi.git diff --git a/gnushogi/init.c b/gnushogi/init.c index 6e4cfce..7b9663b 100644 --- a/gnushogi/init.c +++ b/gnushogi/init.c @@ -2,11 +2,14 @@ * 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 @@ -310,12 +313,12 @@ Initialize_dist(void) /* - * 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 @@ -400,7 +403,7 @@ const small_short direc[NO_PTYPE_PIECES][8] = small_short diagonal(short d) { - return (abs(d) == 10 || abs(d) == 12); + return (abs(d) == (NO_COLS+1) || abs(d) == (NO_COLS+3)); } @@ -512,8 +515,11 @@ Initialize_moves(void) 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++) @@ -1271,8 +1277,6 @@ InitMain(void) if (XSHOGI) { - signal(SIGINT, TerminateSearch); - TCmoves = 40; TCminutes = 5; TCseconds = 0;