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
}
}
- 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))
{
void
+Curses_AlwaysShowMessage(const char *format, ...)
+{
+ static char buffer[60];
+ va_list ap;
+ va_start(ap, format);
+ vsnprintf(buffer, sizeof(buffer), format, ap);
+ Curses_ShowMessage(buffer);
+ va_end(ap);
+}
+
+
+void
Curses_Printf(const char *format, ...)
{
static char buffer[60];
void Curses_ShowGameType(void);
void Curses_ShowLine(unsigned short *bstline);
void Curses_ShowMessage(char *s);
+void Curses_AlwaysShowMessage(const char *format, ...);
void Curses_Printf(const char *format, ...);
void Curses_doRequestInputString(const char* fmt, char* buffer);
void Curses_ShowPatternCount(short side, short n);
DISPLAY_VOIDFUNC(ShowGameType)
DISPLAY_FUNC(ShowLine, (unsigned short *bstline), (bstline))
DISPLAY_FUNC(ShowMessage, (char *s), (s))
+DISPLAY_STDARGFUNC(AlwaysShowMessage, (const char *format, ...), format, (format, ap))
DISPLAY_STDARGFUNC(Printf, (const char *format, ...), format, (format, ap))
DISPLAY_FUNC(ShowPatternCount, (short side, short n), (side, n))
DISPLAY_FUNC(ShowPostnValue, (short sq), (sq))
extern void ShowGameType(void);
extern void ShowLine(unsigned short *bstline);
extern void ShowMessage(char *s);
+extern void AlwaysShowMessage(const char *format, ...);
extern void Printf(const char *format, ...);
extern void RequestInputString(char* buffer, unsigned bufsize);
extern void ShowPatternCount(short side, short n);
printf("%s\n", s);
}
+void
+Raw_AlwaysShowMessage(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ vprintf(format, ap);
+ va_end(ap);
+ printf("\n");
+}
void
Raw_Printf(const char *format, ...)
void Raw_ShowGameType(void);
void Raw_ShowLine(unsigned short *bstline);
void Raw_ShowMessage(char *s);
+void Raw_AlwaysShowMessage(const char *format, ...);
void Raw_Printf(const char *format, ...);
void Raw_doRequestInputString(const char* fmt, char* buffer);
void Raw_ShowPatternCount(short side, short n);