- 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' 어떤 형태든 동일한 정규형으로 떨어져 매치.
13 lines
577 B
MCFunction
13 lines
577 B
MCFunction
# aliases 배열 첫 원소와 비교 → 매치 시 즉시 종료, 아니면 pop 후 재귀
|
|
execute store result score alen func.temp run data get storage mq:tmp aliases
|
|
execute if score alen func.temp matches 0 run return 0
|
|
|
|
data modify storage mq:tmp norm.in set from storage mq:tmp aliases[0]
|
|
function mq:answer/normalize
|
|
data modify storage mq:tmp judge.answer set from storage mq:tmp norm.acc
|
|
function mq:answer/macro/match with storage mq:tmp judge
|
|
data remove storage mq:tmp aliases[0]
|
|
|
|
execute if score @s answer matches 1 run return 0
|
|
function mq:answer/iter_aliases
|