From 8206cbccfded79576665558e2ff253ec3bde34dd Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Sat, 30 Sep 2023 19:21:19 +0800 Subject: [PATCH] further fix the bug --- src/autoimprove1.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/autoimprove1.py b/src/autoimprove1.py index af4fb1b..4b997ba 100755 --- a/src/autoimprove1.py +++ b/src/autoimprove1.py @@ -171,8 +171,9 @@ def ATest(): # check the output print(lines) total_round+=1 - if lines[0]=='YOU WIN!\n': - win_round+=1 + if len(lines)>0: + if lines[0]=='YOU WIN!\n': + win_round+=1 print("win rate: "+str(win_round/total_round),win_round,total_round) return win_round/total_round