summaryrefslogtreecommitdiffstats
path: root/mbbsd/gomo.c
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-15 17:15:20 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-15 17:15:20 +0800
commit7cf467de869336579256b535fa605b0aa53b991c (patch)
tree4d66cef7000f24e060e4f970dfeb9842da83b290 /mbbsd/gomo.c
parent98f0f5e0a45c6771ce43d69a13aa9b9ecce3faf9 (diff)
downloadpttbbs-7cf467de869336579256b535fa605b0aa53b991c.tar
pttbbs-7cf467de869336579256b535fa605b0aa53b991c.tar.gz
pttbbs-7cf467de869336579256b535fa605b0aa53b991c.tar.bz2
pttbbs-7cf467de869336579256b535fa605b0aa53b991c.tar.lz
pttbbs-7cf467de869336579256b535fa605b0aa53b991c.tar.xz
pttbbs-7cf467de869336579256b535fa605b0aa53b991c.tar.zst
pttbbs-7cf467de869336579256b535fa605b0aa53b991c.zip
gomoku and go logging update
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3037 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/gomo.c')
-rw-r--r--mbbsd/gomo.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/mbbsd/gomo.c b/mbbsd/gomo.c
index 561c4003..6c08565f 100644
--- a/mbbsd/gomo.c
+++ b/mbbsd/gomo.c
@@ -238,8 +238,8 @@ static char*
gomo_getstep(const gomo_step_t* step, char buf[])
{
const static char* const ColName = "¢Ï¢Ð¢Ñ¢Ò¢Ó¢Ô¢Õ¢Ö¢×¢Ø¢Ù¢Ú¢Û¢Ü";
- const static char* const RawName = "¢°¢±¢²¢³¢´¢µ¢¶¢·¢¸101112131415";
- const static int ansi_length = sizeof(ANSI_COLOR(30;43));
+ const static char* const RawName = "151413121110¢¸¢·¢¶¢µ¢´¢³¢²¢±¢°";
+ const static int ansi_length = sizeof(ANSI_COLOR(30;43)) - 1;
strcpy(buf, turn_color[step->color]);
buf[ansi_length ] = ColName[step->loc.c * 2];
@@ -410,7 +410,7 @@ gomo_genlog(ChessInfo* info, FILE* fp, ChessGameResult result)
const int nStep = info->history.used;
int i;
- for (i = 1; i < 18; i++)
+ for (i = 1; i <= 18; i++)
fprintf(fp, "%.*s\n", big_picture[i].len, big_picture[i].data);
fprintf(fp, "<gomokulog>\nblack:%s\nwhite:%s\n",
@@ -420,8 +420,11 @@ gomo_genlog(ChessInfo* info, FILE* fp, ChessGameResult result)
for (i = 0; i < nStep; ++i) {
const gomo_step_t* const step =
(const gomo_step_t*) ChessHistoryRetrieve(info, i);
- fprintf(fp, "[%2d]%s ==> %c%-5d", i + 1, bw_chess[i % 2],
- 'A' + step->loc.c, step->loc.r + 1);
+ if (step->type == CHESS_STEP_NORMAL)
+ fprintf(fp, "[%2d]%s ==> %c%-5d", i + 1, bw_chess[step->color],
+ 'A' + step->loc.c, 15 - step->loc.r);
+ else
+ break;
if (i % 2)
fputc('\n', fp);
}