From efcb5ade4a118934093c6470240d0f8c397ebd17 Mon Sep 17 00:00:00 2001 From: TadaoYamaoka Date: Wed, 18 Jan 2023 23:24:10 +0900 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E3=81=97=E6=89=8B=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cshogi/KI2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cshogi/KI2.py b/cshogi/KI2.py index e741283..bb2d0a1 100644 --- a/cshogi/KI2.py +++ b/cshogi/KI2.py @@ -154,10 +154,13 @@ def parse_str(kif_str): if len(line) == 0: pass elif line[0] == "*": - if line[:2] == "**": + if len(moves) > 0: if len(moves) - len(comments) > 1: comments.extend([None]*(len(moves) - len(comments) - 1)) - comments.append(line[2:]) + if line[:2] == "**": + comments.append(line[2:]) + else: + comments.append(line[1:]) else: header_comments.append(line[1:]) elif ':' in line: