* salvo option by: Chuck A DeGaul
* with improved user interface, autoconfiguration and code cleanup
* by Eric S. Raymond <esr@snark.thyrsus.com>
- *
- * $Id: bs.c,v 1.9 2001/05/07 20:27:59 esr Exp esr $
*/
#include <curses.h>
#include <assert.h>
#include <time.h>
#include <unistd.h>
+#include <stdlib.h>
+#include <stdbool.h>
#ifndef SIGIOT
#define SIGIOT SIGABRT
static int turn; /* 0=player, 1=computer */
static int plywon=0, cpuwon=0; /* How many games has each won? */
-static int salvo, blitz, closepack;
+static bool salvo, blitz, closepack;
#define PR (void)addstr
switch(op[i][1])
{
case 'b':
- blitz = 1;
- if (salvo == 1)
+ blitz = true;
+ if (salvo)
{
(void) fprintf(stderr,
"Bad Arg: -b and -s are mutually exclusive\n");
}
break;
case 's':
- salvo = 1;
- if (blitz == 1)
+ salvo = true;
+ if (blitz)
{
(void) fprintf(stderr,
"Bad Arg: -s and -b are mutually exclusive\n");
}
break;
case 'c':
- closepack = 1;
+ closepack = true;
break;
default:
(void) fprintf(stderr,