Archived
0
0

组件消息现代化

This commit is contained in:
2025-11-09 12:04:01 +08:00
parent 330846a4a5
commit 35ed4e63be
4 changed files with 70 additions and 56 deletions

View File

@@ -9,15 +9,16 @@ class ClozePuzzle(BasePuzzle):
min_denominator: 最小概率倒数(如占所有可生成填空数的 1/7 中的 7, 若期望值小于 1, 则取 1)
"""
def __init__(self, text: str, delimiter: str = "/", min_denominator: int):
def __init__(self, text: str, min_denominator: int, delimiter: str = "/"):
self.text = text
self.min_denominator = min_denominator
self.wording = "填空题 - 尚未刷新谜题"
self.answer = ["填空题 - 尚未刷新谜题"]
self.delimiter = delimiter
def refresh(self): # 刷新谜题
placeholder = "___SLASH___"
tmp_text = self.text.replace(delimiter, placeholder)
tmp_text = self.text.replace(self.delimiter, placeholder)
words = tmp_text.split(placeholder)
if not words:
return