X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Fcommondsp.c;h=55201aae3e868e3acbb0aba0befd6a00afd57bf7;hb=8b72032924de9040facee8d8923536541a6b9390;hp=157d852f49951975b5dc0d728477de10b47fdfac;hpb=35748cbc0a7747d94b9c6c1e5d675b7a2c58320f;p=gnushogi.git diff --git a/gnushogi/commondsp.c b/gnushogi/commondsp.c index 157d852..55201aa 100644 --- a/gnushogi/commondsp.c +++ b/gnushogi/commondsp.c @@ -42,7 +42,6 @@ #include #include -#include #include "gnushogi.h" char mvstr[4][6]; @@ -298,20 +297,7 @@ VerifyMove(char *s, VerifyMove_mode iop, unsigned short *mv) if (SqAttacked(PieceList[opponent][0], computer, &blocked)) { UnmakeMove(opponent, &xnode, &tempb, &tempc, &tempsf, &tempst); - - if (NOT_CURSES) - { - /* Illegal move in check */ - printf(CP[77], s); - printf("\n"); - } - else - { - /* Illegal move in check */ - sprintf(buffer, CP[77], s); - ShowMessage(buffer); - } - + AlwaysShowMessage(CP[77], s); return false; } else @@ -353,17 +339,7 @@ VerifyMove(char *s, VerifyMove_mode iop, unsigned short *mv) } } - 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)) { @@ -1385,7 +1361,7 @@ TestSpeed(void(*f)(short side, short ply, #endif unsigned i; - long cnt, rate, t1, t2; + long cnt, t1, t2; #ifdef HAVE_GETTIMEOFDAY struct timeval tv; @@ -1425,17 +1401,7 @@ TestSpeed(void(*f)(short side, short ply, 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); } @@ -1444,7 +1410,7 @@ void 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 @@ -1473,14 +1439,7 @@ TestPSpeed(short(*f) (short side), unsigned j) 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); } @@ -1609,16 +1568,7 @@ InputCommand(char *command) Sdepth = 0; #ifdef QUIETBACKGROUND - if (NOT_CURSES) - { - PromptForMove(); - } - else - { - ShowSidetoMove(); - ShowPrompt(); - } - + ShowPrompt(); have_shown_prompt = true; #endif /* QUIETBACKGROUND */ @@ -1665,15 +1615,7 @@ InputCommand(char *command) { #endif /* QUIETBACKGROUND */ - if (NOT_CURSES) - { - PromptForMove(); - } - else - { - ShowSidetoMove(); - ShowPrompt(); - } + ShowPrompt(); #ifdef QUIETBACKGROUND } @@ -1681,23 +1623,12 @@ InputCommand(char *command) 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; }