summaryrefslogtreecommitdiffstats
path: root/mbbsd/othello.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/othello.c')
-rw-r--r--mbbsd/othello.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/mbbsd/othello.c b/mbbsd/othello.c
index 9431e7df..99dd4794 100644
--- a/mbbsd/othello.c
+++ b/mbbsd/othello.c
@@ -494,12 +494,16 @@ choose(void)
move(2, 0);
outs("請選擇難度:");
move(5, 0);
- outs("(1) CD-65\n"); /* 想 1 步 */
+ outs("[0] 離開\n");
+ outs("(1) CD-65\n");/* 想 1 步 */
outs("(2) 嬰兒\n"); /* 想 3 步 */
outs("(3) 小孩\n"); /* 想 4 步 */
do {
- getdata(4, 0, "請選擇一個對象和您對打:(1~3)",
- thinkstep, sizeof(thinkstep), LCECHO);
+ if (getdata(4, 0, "請選擇一個對象和您對打:(1~3)",
+ thinkstep, sizeof(thinkstep), LCECHO) == 0 ||
+ thinkstep[0] == '0')
+ return 0;
+
} while (thinkstep[0] < '1' || thinkstep[0] > '3');
clear();
switch (thinkstep[0]) {
@@ -534,7 +538,13 @@ othello_main(void)
clear();
init(od);
od->think = choose();
- showtitle("黑白棋", BBSName);
+ if (!od->think)
+ {
+ unlockutmpmode();
+ free(od);
+ return 0;
+ }
+ showtitle("單人黑白棋", BBSName);
printboard(od);
od->which_table = random() % NR_TABLE;
while (true) {