diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-07-10 23:29:30 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-07-10 23:29:30 +0800 |
commit | 36736d45a8f624bc68831035e65fac5e0bfa54ed (patch) | |
tree | 0549097b74134403f1307136d2006881394d9a71 /mbbsd/gomo.c | |
parent | 70ad127d32badd2cf5a011982789d930d6cb60c0 (diff) | |
parent | 9351e5d49572d05a6aa21309daa315434def299c (diff) | |
download | pttbbs-36736d45a8f624bc68831035e65fac5e0bfa54ed.tar pttbbs-36736d45a8f624bc68831035e65fac5e0bfa54ed.tar.gz pttbbs-36736d45a8f624bc68831035e65fac5e0bfa54ed.tar.bz2 pttbbs-36736d45a8f624bc68831035e65fac5e0bfa54ed.tar.lz pttbbs-36736d45a8f624bc68831035e65fac5e0bfa54ed.tar.xz pttbbs-36736d45a8f624bc68831035e65fac5e0bfa54ed.tar.zst pttbbs-36736d45a8f624bc68831035e65fac5e0bfa54ed.zip |
add some function of fpg
git-svn-id: http://opensvn.csie.org/pttbbs/branches/ptt.fpg@2122 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/gomo.c')
-rw-r--r-- | mbbsd/gomo.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/mbbsd/gomo.c b/mbbsd/gomo.c index 78d6cab5..fcfdf4fb 100644 --- a/mbbsd/gomo.c +++ b/mbbsd/gomo.c @@ -1,15 +1,11 @@ /* $Id$ */ #include "bbs.h" +#include "gomo.h" #define QCAST int (*)(const void *, const void *) -static char * const chess[] = {"●", "○"}; static int tick, lastcount, mylasttick, hislasttick; - -typedef struct { - char x; - char y; -} Horder_t; +static char ku[BRDSIZ][BRDSIZ]; static Horder_t *v; @@ -200,7 +196,7 @@ HO_log(Horder_t *pool, char *user) i = 0; do { - fprintf(log, "[%2d]%s ==> %c%d%c", i + 1, chess[i % 2], + fprintf(log, "[%2d]%s ==> %c%d%c", i + 1, bw_chess[i % 2], 'A' + ptr->x, ptr->y + 1, (i % 2) ? '\n' : '\t'); i++; } while (++ptr < v); @@ -461,7 +457,7 @@ gomoku(int fd) ku[(int)mv.x][(int)mv.y] = he; bell(); BGOTO(mv.x, mv.y); - outs(chess[he - 1]); + outs(bw_chess[he - 1]); if (win) { outmsg(win == 1 ? "對方贏了!" : "對方禁手"); @@ -488,7 +484,7 @@ gomoku(int fd) int win; HO_add(&mv); BGOTO(mv.x, mv.y); - outs(chess[me - 1]); + outs(bw_chess[me - 1]); win = chkmv(&mv, me, me == BBLACK); ku[(int)mv.x][(int)mv.y] = me; mylasttick = tick; |