3 Commits

Author SHA1 Message Date
Claude (owner)
cce5469dc2 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' 어떤 형태든 동일한 정규형으로 떨어져 매치.
2026-05-15 00:23:42 +09:00
Claude (owner)
8c30f4de5e temp: 애니메이션 painting 텍스처 검증용 sample 파일 추가
리소스팩 1번 방식 (.png 세로 스트립 + .png.mcmeta) 이
painting_variant 에서 동작하는지 검증하기 위한 샘플.

사용 위치: musicquiz 리소스팩의
  assets/musicquiz/textures/painting/gif.png
  assets/musicquiz/textures/painting/gif.png.mcmeta

데이터팩 v1.0.6 의 mq:gif painting_variant 와 짝.
2026-05-14 23:58:07 +09:00
Claude (owner)
ae434c3a07 music_quiz: answer/macro/match — NBT path compound matcher 공백 제거
execute if data <source> <path> 의 path 토큰은 공백을 허용하지 않음.
'judge {input:...}' → 'judge{input:...}' 로 붙여써야 compound predicate 가
정상 적용됨.
2026-05-14 23:50:28 +09:00
9 changed files with 82 additions and 5 deletions

View File

@@ -2,7 +2,9 @@
execute store result score alen func.temp run data get storage mq:tmp aliases 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 execute if score alen func.temp matches 0 run return 0
data modify storage mq:tmp judge.answer set from storage mq:tmp aliases[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 function mq:answer/macro/match with storage mq:tmp judge
data remove storage mq:tmp aliases[0] data remove storage mq:tmp aliases[0]

View File

@@ -2,8 +2,10 @@
# 매치되면 @s answer = 1 → check_answer 가 정답처리 흐름으로 진입 # 매치되면 @s answer = 1 → check_answer 가 정답처리 흐름으로 진입
# 매치 안되면 @s answer = 2 → check_answer 가 reset 처리 (1회 비교 후 초기화) # 매치 안되면 @s answer = 2 → check_answer 가 reset 처리 (1회 비교 후 초기화)
# 1) 제목과 비교 # 1) 제목과 비교 (정규화 후)
data modify storage mq:tmp judge.answer set from storage mq:main answer.title data modify storage mq:tmp norm.in set from storage mq:main answer.title
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 function mq:answer/macro/match with storage mq:tmp judge
# 2) 제목 매치 실패 시 alias 들과 순차 비교 (조기 종료) # 2) 제목 매치 실패 시 alias 들과 순차 비교 (조기 종료)

View File

@@ -1,3 +1,3 @@
# judge.input 과 judge.answer 가 같으면 @s answer = 1 # judge.input 과 judge.answer 가 같으면 @s answer = 1
# 매크로 치환으로 answer 필드를 NBT predicate 의 리터럴로 박아넣음 # 매크로 치환으로 answer 필드를 NBT predicate 의 리터럴로 박아넣음
$execute if data storage mq:tmp judge {input:"$(answer)"} run scoreboard players set @s answer 1 $execute if data storage mq:tmp judge{input:"$(answer)"} run scoreboard players set @s answer 1

View File

@@ -0,0 +1,13 @@
# 입력 문자열 정규화 — 소문자 변환 + 공백 제거 (대소문자/공백 무시 비교용)
#
# 입력 : storage mq:tmp norm.in (원본 문자열)
# 출력 : storage mq:tmp norm.acc (정규화 결과)
#
# 호출 예:
# data modify storage mq:tmp norm.in set from storage mq:main answer.title
# function mq:answer/normalize
# # 이후 storage mq:tmp norm.acc 에 결과
#
# 동작: norm.in 을 한 글자씩 떼어내며 normalize/step 으로 재귀
data modify storage mq:tmp norm.acc set value ""
function mq:answer/normalize/step

View File

@@ -0,0 +1,3 @@
# acc 끝에 c 를 매크로로 concat
# 매크로 인자: storage mq:tmp norm → $(acc), $(c)
$data modify storage mq:tmp norm.acc set value "$(acc)$(c)"

View File

@@ -0,0 +1,47 @@
# normalize 의 1-문자 처리 + 재귀 스텝
# 사전조건: storage mq:tmp norm.in 비어있지 않을 수 있음 / norm.acc 누적값
execute store result score n.len func.temp run data get storage mq:tmp norm.in
execute if score n.len func.temp matches 0 run return 0
# 머리글자 추출 → norm.c
data modify storage mq:tmp norm.c set string from storage mq:tmp norm.in 0 1
# 공백 제거 (스킵)
execute if data storage mq:tmp norm{c:" "} run data modify storage mq:tmp norm.c set value ""
# 대문자 A-Z → 소문자 a-z
execute if data storage mq:tmp norm{c:"A"} run data modify storage mq:tmp norm.c set value "a"
execute if data storage mq:tmp norm{c:"B"} run data modify storage mq:tmp norm.c set value "b"
execute if data storage mq:tmp norm{c:"C"} run data modify storage mq:tmp norm.c set value "c"
execute if data storage mq:tmp norm{c:"D"} run data modify storage mq:tmp norm.c set value "d"
execute if data storage mq:tmp norm{c:"E"} run data modify storage mq:tmp norm.c set value "e"
execute if data storage mq:tmp norm{c:"F"} run data modify storage mq:tmp norm.c set value "f"
execute if data storage mq:tmp norm{c:"G"} run data modify storage mq:tmp norm.c set value "g"
execute if data storage mq:tmp norm{c:"H"} run data modify storage mq:tmp norm.c set value "h"
execute if data storage mq:tmp norm{c:"I"} run data modify storage mq:tmp norm.c set value "i"
execute if data storage mq:tmp norm{c:"J"} run data modify storage mq:tmp norm.c set value "j"
execute if data storage mq:tmp norm{c:"K"} run data modify storage mq:tmp norm.c set value "k"
execute if data storage mq:tmp norm{c:"L"} run data modify storage mq:tmp norm.c set value "l"
execute if data storage mq:tmp norm{c:"M"} run data modify storage mq:tmp norm.c set value "m"
execute if data storage mq:tmp norm{c:"N"} run data modify storage mq:tmp norm.c set value "n"
execute if data storage mq:tmp norm{c:"O"} run data modify storage mq:tmp norm.c set value "o"
execute if data storage mq:tmp norm{c:"P"} run data modify storage mq:tmp norm.c set value "p"
execute if data storage mq:tmp norm{c:"Q"} run data modify storage mq:tmp norm.c set value "q"
execute if data storage mq:tmp norm{c:"R"} run data modify storage mq:tmp norm.c set value "r"
execute if data storage mq:tmp norm{c:"S"} run data modify storage mq:tmp norm.c set value "s"
execute if data storage mq:tmp norm{c:"T"} run data modify storage mq:tmp norm.c set value "t"
execute if data storage mq:tmp norm{c:"U"} run data modify storage mq:tmp norm.c set value "u"
execute if data storage mq:tmp norm{c:"V"} run data modify storage mq:tmp norm.c set value "v"
execute if data storage mq:tmp norm{c:"W"} run data modify storage mq:tmp norm.c set value "w"
execute if data storage mq:tmp norm{c:"X"} run data modify storage mq:tmp norm.c set value "x"
execute if data storage mq:tmp norm{c:"Y"} run data modify storage mq:tmp norm.c set value "y"
execute if data storage mq:tmp norm{c:"Z"} run data modify storage mq:tmp norm.c set value "z"
# acc = acc + c (매크로 결합)
function mq:answer/normalize/append with storage mq:tmp norm
# 나머지로 진행
data modify storage mq:tmp norm.in set string from storage mq:tmp norm.in 1
function mq:answer/normalize/step

View File

@@ -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 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 실행 # 매크로로 해당 seq 를 가진 플레이어 찾아서 judge 실행
data modify storage mq:tmp _find set value {seq:0} data modify storage mq:tmp _find set value {seq:0}

BIN
temp/gif.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

6
temp/gif.png.mcmeta Normal file
View File

@@ -0,0 +1,6 @@
{
"animation": {
"frametime": 1,
"interpolate": false
}
}