From 173902a9abb0660674a6d3769a6099c50ff511f6 Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Sat, 30 Sep 2023 18:07:53 +0800 Subject: [PATCH] fix the bug of improve stoping --- src/autoimprove1.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/autoimprove1.py b/src/autoimprove1.py index bec6ddb..af4fb1b 100755 --- a/src/autoimprove1.py +++ b/src/autoimprove1.py @@ -124,8 +124,9 @@ def ATest(): fn.close() 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) #input("Press Enter to continue...")