summaryrefslogtreecommitdiffstats
path: root/mbbsd/gomo.c
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-07-04 15:55:01 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-07-04 15:55:01 +0800
commit45cf571a04e8a8781c1664cc6e993f4a09118e07 (patch)
treec34dbcc5b2aa76b0c8630f6a88c48cdeec9df454 /mbbsd/gomo.c
parente4562242b17b1d5d0dbf779a87e486528295c600 (diff)
downloadpttbbs-45cf571a04e8a8781c1664cc6e993f4a09118e07.tar
pttbbs-45cf571a04e8a8781c1664cc6e993f4a09118e07.tar.gz
pttbbs-45cf571a04e8a8781c1664cc6e993f4a09118e07.tar.bz2
pttbbs-45cf571a04e8a8781c1664cc6e993f4a09118e07.tar.lz
pttbbs-45cf571a04e8a8781c1664cc6e993f4a09118e07.tar.xz
pttbbs-45cf571a04e8a8781c1664cc6e993f4a09118e07.tar.zst
pttbbs-45cf571a04e8a8781c1664cc6e993f4a09118e07.zip
GO game merged from FPG.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2113 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/gomo.c')
-rw-r--r--mbbsd/gomo.c14
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;