home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume2
/
dots2
/
dots.h
< prev
next >
Wrap
C/C++ Source or Header
|
1987-09-18
|
3KB
|
119 lines
/* dots.h */
#include <curses.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#if defined(lint) && defined(BSD)
#include <sys/uio.h>
#endif /* lint && BSD */
#ifdef BSD
#include <sys/socket.h>
#endif /* BSD */
#include <ctype.h>
#include <signal.h>
#include <setjmp.h>
#ifdef BSD
#include <strings.h>
#else
#include <string.h>
#endif /* BSD */
#ifdef BSD
extern char *sprintf();
#else
extern int sprintf();
#endif /* BSD */
/* Most BSD systems don't have vprintf, but sun versions 3.0 and up do have it.
* If you're system doesn't have it, comment out the define line. System-V
* systems do have it.
*/
#ifdef SYSV
#define VPRINTF
#endif /* SYSV */
#ifdef SYSV
#define SIGCHLD SIGCLD
#define srandom srand
#define random rand
#define index strchr
#define rindex strrchr
#endif /* SYSV */
#define PRIZE "cigar"
#define DOCFILE "/usr/games/lib/dots/dots.doc"
#define SAVE_FILE "dots.save"
#define SCOREFILE "/usr/games/lib/dots/dots.scores" /* should be full pathname */
#define version "Dots version 2.0"
#define when break;case
#define otherwise break;default
#define Upper(c) (c = islower(c) ? toupper(c) : c)
#define Lower(c) (c = isupper(c) ? tolower(c) : c)
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define erase_char '\b'
#define ESC '\033'
#define DEMO 0
#define INTERACTIVE 1
#define TWOPLAYER 2
#define GOOD 0
#define BAD 1
#define DUMB 0
#define HARD 1
#define KILLER 2
#define FREE 0
#define USED 1
#define CLOSEDEND 0 /* used for segtype for creating doublecrosses */
#define OPENEND 1 /* ditto */
#define MAXL (COLS / 4)
#define MAXW (LINES / 2)
#define H_MINL 10
#define H_MINW 10
#define MINL 4
#define MINW 4
#define US 0
#define THEM 1
#define SAVE 0
#define LOAD 1
#define isodd(a) ((a)%2)
#define iseven(a) (!isodd(a))
#define ism4(a) (!((a)%4))
#define do_twice for(twicecount=1;twicecount<=2;++twicecount)
int
board[120][120],
badboard[120][120],
persontally, comptally,
Length, Width,
xposit, yposit,
x_start, y_start,
mover, /* 0 is person/US, 1 is computer/THEM */
twicecount,
no_good_moves,
control_already_established,
segtype, /* OPENEND or CLOSEDEND ; set everytime Howbad is called */
dX_found,
segflag,
mode,
level,
sd, /* socket descriptor */
jmpbuf_set;
struct {
int x, y;
} Bingo;
struct tchars tchars;
char *opponent, prize[30], save_file[50], *getenv();
char Initial[2], *username;
int onintr(), redraw(), oops();
/* jump to the menu so there's no big stacks (supposedly) */
jmp_buf menu_jmp;
extern int errno;
extern char *sys_errlist[], *sys_siglist[];