summaryrefslogtreecommitdiffstats
path: root/include/chc.h
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-08 22:00:40 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-08 22:00:40 +0800
commit72fa46586658fa5a7e797e66167583b17cb5a858 (patch)
tree94f45384e659aa3d8cf2d7722b997f8ad7ab5252 /include/chc.h
parentc0ffbd8f8c761ca8a86b463686c8a54202ddc2b9 (diff)
downloadpttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.gz
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.bz2
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.lz
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.xz
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.zst
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.zip
fix chess internal coordinate.
!! NOTE !!, not compatible with older revision. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3009 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include/chc.h')
-rw-r--r--include/chc.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/chc.h b/include/chc.h
index 31aa49bc..eb1bae83 100644
--- a/include/chc.h
+++ b/include/chc.h
@@ -32,9 +32,10 @@
#define CHE_O(c) ((c) >> 3)
#define CHE_P(c) ((c) & 7)
-#define RTL(x) (((x) - 3) >> 1)
+#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(x) ((x) * 2 + 3)
+#define LTR(myturn, x) ((((myturn)==BLK?BRD_ROW-1-(x):(x)) * 2) + 3)
#define CHE(a, b) ((a) | ((b) << 3))
#define BLACK_COLOR ANSI_COLOR(1;36)