From a0f8ef1e2e04905908478088fc376435b770417c Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 8 Jun 2005 02:46:24 +0000 Subject: New style to specify ANSI escape commands. First introduced by pmore, but this hard work (to transform all files to new style) is made by Rong-en Fan (rafan). Thanks! git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2796 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/guess.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mbbsd/guess.c') diff --git a/mbbsd/guess.c b/mbbsd/guess.c index a6bd7ddb..766cbd16 100644 --- a/mbbsd/guess.c +++ b/mbbsd/guess.c @@ -8,10 +8,10 @@ show_table(char TABLE[], char ifcomputer) int i; move(0, 35); - outs("\033[1;44;33m 【 猜數字 】 \033[m"); + outs(ANSI_COLOR(1;44;33) " 【 猜數字 】 " ANSI_RESET); move(8, 1); - outs("\033[1;44;36m目 前 倍 率\033[m\n"); - outs("\033[1;33m=================\033[m\n"); + outs(ANSI_COLOR(1;44;36) "目 前 倍 率" ANSI_RESET "\n"); + outs(ANSI_COLOR(1;33) "=================" ANSI_RESET "\n"); if (ifcomputer) { outs("贏電腦: 2 倍\n"); outs("輸電腦: 0 倍\n"); @@ -19,7 +19,7 @@ show_table(char TABLE[], char ifcomputer) for (i = 1; i <= 6; i++) prints("第%d次, %02d倍\n", i, TABLE[i]); } - outs("\033[33m=================\033[m"); + outs(ANSI_COLOR(33) "=================" ANSI_RESET); } static int @@ -105,7 +105,7 @@ guess_play(const char *data, const char *answer, int count) if (A_num == 4) return 1; move(count + 8, 55); - prints("%s => \033[1;32m%dA %dB\033[m", data, A_num, B_num); + prints("%s => " ANSI_COLOR(1;32) "%dA %dB" ANSI_RESET, data, A_num, B_num); return 0; } @@ -178,7 +178,7 @@ computer(int correct, int total, char flag[], int n[]) } else { move(total + 8, 25); snprintf(data, sizeof(data), "%04d", guess); - prints("%s => \033[1;32m%dA %dB\033[m", data, k / 10, k % 10); + prints("%s => " ANSI_COLOR(1;32) "%dA %dB" ANSI_RESET, data, k / 10, k % 10); } j = 0; for (i = 0; i < 10000; i++) -- cgit v1.2.3