-/* $NetBSD: main.c,v 1.24 2010/03/29 04:28:47 dholland Exp $ */
+/* $NetBSD: main.c,v 1.27 2016/06/12 02:15:26 dholland Exp $ */
/*
* Copyright (c) 1994
#if 0
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: main.c,v 1.24 2010/03/29 04:28:47 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.27 2016/06/12 02:15:26 dholland Exp $");
#endif
#endif /* not lint */
#define PROGRAM 1 /* get input from program */
#define INPUTF 2 /* get input from a file */
+#define LOGIN_NAME_MAX 73
+
int interactive = 1; /* true if interactive */
int debug; /* true if debugging */
static int test; /* both moves come from 1: input, 2: computer */
char *tmp;
int color, curmove, i, ch;
int input[2];
- static const char *const fmt[2] = {
- "%3d %-6s",
- "%3d %-6s"
- };
/* Revoke setgid privileges */
setgid(getgid());
}
if (!debug)
-#ifdef SVR4
- srand(time(0));
-#else
srandom(time(0));
-#endif
if (interactive)
cursinit(); /* initialize curses */
again:
break;
}
if (interactive) {
- misclog(fmt[color], movenum, stoc(curmove));
+ misclog("%3d%s%-6s", movenum, color ? " " : " ",
+ stoc(curmove));
}
if ((i = makemove(color, curmove)) != MOVEOK)
break;
{
va_list ap;
+ if (interactive) {
+ bdisp();
+ cursfini();
+ }
+
fprintf(stderr, "%s: ", prog);
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, "\n");
- fputs("resign\n", stdout);
- quit();
+ fputs("I resign\n", stdout);
+ exit(1);
}