diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-09 01:28:04 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-09 01:28:04 +0800 |
commit | bd2018496f8a1b501932ac29e4cab72a1a94717c (patch) | |
tree | 9b3634c14ca22803002f5bcdd47a3276b7cfbd29 /include/chc.h | |
parent | 749b08d0e4d06e3e6b17f0675d8dae507f5cbf4c (diff) | |
download | pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.gz pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.bz2 pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.lz pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.xz pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.zst pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.zip |
use REDDOWN() macro to indicate chessboard flipping status.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3014 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include/chc.h')
-rw-r--r-- | include/chc.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/chc.h b/include/chc.h index eb1bae83..f6512563 100644 --- a/include/chc.h +++ b/include/chc.h @@ -32,11 +32,13 @@ #define CHE_O(c) ((c) >> 3) #define CHE_P(c) ((c) & 7) -#define RTL(myturn, x) ((myturn)==BLK?BRD_ROW-1-((x)-3)/2:((x)-3)/2) -#define CTL(myturn, x) ((myturn)==BLK?BRD_COL-1-(x):(x)) #define dim(x) (sizeof(x) / sizeof(x[0])) -#define LTR(myturn, x) ((((myturn)==BLK?BRD_ROW-1-(x):(x)) * 2) + 3) #define CHE(a, b) ((a) | ((b) << 3)) +/* TODO let user flip chessboard */ +#define REDDOWN(info) ((info)->myturn==RED) +#define RTL(info, x) (REDDOWN(info)?((x)-3)/2:BRD_ROW-1-((x)-3)/2) +#define CTL(info, x) (REDDOWN(info)?(x):BRD_COL-1-(x)) +#define LTR(info, x) (((REDDOWN(info)?(x):BRD_ROW-1-(x)) * 2) + 3) #define BLACK_COLOR ANSI_COLOR(1;36) #define RED_COLOR ANSI_COLOR(1;31) |