-/* $NetBSD: bdisp.c,v 1.14 2010/03/29 03:51:55 dholland Exp $ */
+/* $NetBSD: bdisp.c,v 1.17 2014/03/22 18:58:57 dholland Exp $ */
/*
* Copyright (c) 1994
#if 0
static char sccsid[] = "@(#)bdisp.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: bdisp.c,v 1.14 2010/03/29 03:51:55 dholland Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.17 2014/03/22 18:58:57 dholland Exp $");
#endif
#endif /* not lint */
static int lastline;
static char pcolor[] = "*O.?";
-extern int interactive;
-extern char *plyr[];
-
/*
* Initialize screen display.
*/
refresh();
}
+int
+get_key(const char *allowed)
+{
+ int ch;
+
+ while (1) {
+ ch = getch();
+ if (allowed != NULL &&
+ ch != '\0' && strchr(allowed, ch) == NULL) {
+ beep();
+ refresh();
+ continue;
+ }
+ break;
+ }
+ return ch;
+}
+
int
get_line(char *buf, int size)
{
nx = curx;
ny = cury;
for (;;) {
- mvprintw(BSZ3, (BSZ -6)/2, "(%c %d)",
+ mvprintw(BSZ3, (BSZ -6)/2, "(%c %d) ",
'A'+ ((curx > 7) ? (curx+1) : curx), cury + 1);
BGOTO(cury, curx);
break;
#endif /* 0 */
case 'Q':
+ case 'q':
return RESIGN;
break;
case 'S':
+ case 's':
return SAVE;
break;
case ' ':