#include <sys/types.h>
#include <sys/file.h>
-#include <curses.h>
#include "gnushogi.h"
char mvstr[4][6];
if (SqAttacked(PieceList[opponent][0], computer, &blocked))
{
UnmakeMove(opponent, &xnode, &tempb, &tempc, &tempsf, &tempst);
-
- if (NOT_CURSES)
- {
- /* Illegal move in check */
- printf(CP[77], mvstr[0]);
- printf("\n");
- }
- else
- {
- /* Illegal move in check */
- sprintf(buffer, CP[77], s);
- ShowMessage(buffer);
- }
-
+ AlwaysShowMessage(CP[77], s);
return false;
}
else
}
}
- if (NOT_CURSES)
- {
- /* Illegal move */
- printf (CP[75], s);
- }
- else /* Curses. */
- {
- /* Illegal move */
- sprintf(buffer, CP[76], s);
- ShowMessage(buffer);
- }
+ AlwaysShowMessage(CP[76], s);
if (!barebones && (cnt > 1))
{
#endif
unsigned i;
- long cnt, rate, t1, t2;
+ long cnt, t1, t2;
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
else
et = 1;
- rate = (((et) ? ((cnt * 100) / et) : 0));
-
-#ifdef DYNAMIC_ZNODES
- if (rate > 0)
- znodes = rate;
-#endif
-
- if (NOT_CURSES)
- printf(CP[91], cnt, rate);
- else
- ShowNodeCnt(cnt);
+ ShowNodeCnt(cnt);
}
TestPSpeed(short(*f) (short side), unsigned j)
{
short i;
- long cnt, rate, t1, t2;
+ long cnt, t1, t2;
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
#endif
else
et = 1;
- rate = (et) ? ((cnt * 100) / et) : 0;
-
- /* printf("Nodes= %ld Nodes/sec= %ld\n", cnt, rate); */
-
- if (NOT_CURSES)
- printf(CP[91], cnt, rate);
- else
- ShowNodeCnt(cnt);
+ ShowNodeCnt(cnt);
}
Sdepth = 0;
#ifdef QUIETBACKGROUND
- if (NOT_CURSES)
- {
- PromptForMove();
- }
- else
- {
- ShowSidetoMove();
- ShowPrompt();
- }
-
+ ShowPrompt();
have_shown_prompt = true;
#endif /* QUIETBACKGROUND */
{
#endif /* QUIETBACKGROUND */
- if (NOT_CURSES)
- {
- PromptForMove();
- }
- else
- {
- ShowSidetoMove();
- ShowPrompt();
- }
+ ShowPrompt();
#ifdef QUIETBACKGROUND
}
have_shown_prompt = false;
#endif /* QUIETBACKGROUND */
- if (command == NULL)
- {
+ if (command == NULL) {
if (NOT_CURSES)
- {
- s[0] = sx[0] = '\0';
+ s[0] = '\0';
- while(!eof && !sx[0])
- eof = (fgets(sx, 80, stdin) == NULL);
- }
- else
- {
- fflush(stdout);
- eof = (getstr(sx) == ERR);
- }
- }
- else
- {
+ eof = GetString(sx);
+ } else {
strcpy(sx, command);
done = true;
}
{
EditBoard();
}
- else if (NOT_CURSES && (strcmp(s, CP[190]) == 0)) /* setup */
+ else if ((strcmp(s, CP[190]) == 0)) /* setup */
{
SetupBoard();
}