diff options
Diffstat (limited to 'backgammon/common_source/back.h')
-rw-r--r-- | backgammon/common_source/back.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/backgammon/common_source/back.h b/backgammon/common_source/back.h index 815a5ec2..e008a6f9 100644 --- a/backgammon/common_source/back.h +++ b/backgammon/common_source/back.h @@ -1,4 +1,4 @@ -/* $NetBSD: back.h,v 1.18 2011/08/26 06:18:16 dholland Exp $ */ +/* $NetBSD: back.h,v 1.19 2012/10/13 18:44:14 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -46,7 +46,20 @@ #define rnum(r) (random()%r) #define D0 dice[0] #define D1 dice[1] -#define swap {D0 ^= D1; D1 ^= D0; D0 ^= D1; d0 = 1-d0;} +#define mswap(m) {(m)->D0 ^= (m)->D1; (m)->D1 ^= (m)->D0; (m)->D0 ^= (m)->D1; (m)->d0 = 1-(m)->d0;} +#define swap suck it + +struct move { + int dice[2]; /* value of dice */ + int mvlim; /* 'move limit': max. number of moves */ + int p[5]; /* starting position of moves */ + int g[5]; /* ending position of moves (goals) */ + int h[4]; /* flag for each move if a man was hit */ + int d0; /* flag if dice have been reversed from + original position */ +}; + +extern struct move gm; /* * @@ -83,20 +96,12 @@ extern int rfl; /* saved value of rflag */ extern int iroll; /* special flag for inputting rolls */ extern int board[26]; /* board: negative values are white, positive are red */ -extern int dice[2]; /* value of dice */ -extern int mvlim; /* 'move limit': max. number of moves */ -extern int mvl; /* working copy of mvlim */ -extern int p[5]; /* starting position of moves */ -extern int g[5]; /* ending position of moves (goals) */ -extern int h[4]; /* flag for each move if a man was hit */ extern int cturn; /* whose turn it currently is: -1 = white 1 = red 0 = just quitted -2 = white just lost 2 = red just lost */ -extern int d0; /* flag if dice have been reversed from - original position */ extern int table[6][6]; /* odds table for possible rolls */ extern int rscore; /* red's score */ extern int wscore; /* white's score */ |