music_quiz: answer 정규화 도입 (대소문자/공백 무시)
- mq:answer/normalize: storage 의 norm.in 을 한 글자씩 떼어내 소문자화 + 공백 제거 후 norm.acc 에 누적. char 단위 반복은 'data modify ... set string from ... <start> <end>' (1.20+) 로, 결합은 매크로 ($(acc)$(c)) 로 수행하는 pure-datapack 구현. - process: 큐의 text 를 정규화한 결과를 judge.input 으로 사용 - judge: answer.title 정규화 후 judge.answer 로 사용 - iter_aliases: alias 각 항목 정규화 후 비교 원본 songs.mcfunction 의 title/alias 표기는 그대로 유지 (display 및 정규화 입력으로 모두 사용됨). 입력이 'Lose My Mind' / 'lose my mind' / 'LOSEMYMIND' / 'losemymind' 어떤 형태든 동일한 정규형으로 떨어져 매치.
This commit is contained in:
@@ -5,7 +5,11 @@ execute if score qlen func.temp matches 0 run return 0
|
||||
|
||||
# 첫번째 항목 = 가장 먼저 제출된 것
|
||||
data modify storage mq:tmp judge set value {input:"", answer:""}
|
||||
data modify storage mq:tmp judge.input set from storage mq:input queue[0].text
|
||||
|
||||
# 입력 정규화 (소문자 + 공백제거) — 정답과 비교는 둘 다 정규화된 형태로
|
||||
data modify storage mq:tmp norm.in set from storage mq:input queue[0].text
|
||||
function mq:answer/normalize
|
||||
data modify storage mq:tmp judge.input set from storage mq:tmp norm.acc
|
||||
|
||||
# 매크로로 해당 seq 를 가진 플레이어 찾아서 judge 실행
|
||||
data modify storage mq:tmp _find set value {seq:0}
|
||||
|
||||
Reference in New Issue
Block a user