이전퀴즈 데이터팩
This commit is contained in:
7
music_quiz/data/func/function/comp_num.mcfunction
Normal file
7
music_quiz/data/func/function/comp_num.mcfunction
Normal file
@@ -0,0 +1,7 @@
|
||||
scoreboard objectives add func.temp dummy
|
||||
|
||||
$execute store result score n1 func.temp run data get storage func:temp $(n1)
|
||||
$execute store result score n2 func.temp run data get storage func:temp $(n2)
|
||||
|
||||
execute if score n1 func.temp = n2 func.temp run return 1
|
||||
return 0
|
||||
15
music_quiz/data/func/function/half.mcfunction
Normal file
15
music_quiz/data/func/function/half.mcfunction
Normal file
@@ -0,0 +1,15 @@
|
||||
scoreboard players set two func.temp 2
|
||||
|
||||
$data modify storage func:temp half.result set from storage func:temp $(list)
|
||||
|
||||
execute store result score length func.temp run data get storage func:temp half.result
|
||||
|
||||
scoreboard players operation half func.temp = length func.temp
|
||||
scoreboard players operation half func.temp /= two func.temp
|
||||
|
||||
scoreboard players operation odd func.temp = length func.temp
|
||||
scoreboard players operation odd func.temp %= two func.temp
|
||||
|
||||
scoreboard players operation half func.temp += odd func.temp
|
||||
|
||||
function func:half/f1
|
||||
1
music_quiz/data/func/function/half/f1.mcfunction
Normal file
1
music_quiz/data/func/function/half/f1.mcfunction
Normal file
@@ -0,0 +1 @@
|
||||
execute if score half func.temp < length func.temp run function func:half/f2
|
||||
5
music_quiz/data/func/function/half/f2.mcfunction
Normal file
5
music_quiz/data/func/function/half/f2.mcfunction
Normal file
@@ -0,0 +1,5 @@
|
||||
data remove storage func:temp half.result[-1]
|
||||
|
||||
scoreboard players remove length func.temp 1
|
||||
|
||||
function func:half/f1
|
||||
18
music_quiz/data/func/function/hint.mcfunction
Normal file
18
music_quiz/data/func/function/hint.mcfunction
Normal file
@@ -0,0 +1,18 @@
|
||||
$function func:length {text:"$(text)"}
|
||||
# return length
|
||||
function func:num_list with storage func:temp
|
||||
# return num_list
|
||||
function func:shuffle {list:"num_list"}
|
||||
# return shuffle.result
|
||||
function func:half {list:"shuffle.result"}
|
||||
# return half.result
|
||||
|
||||
$function func:length {text:"$(text)"}
|
||||
# return length
|
||||
function func:text_list with storage func:temp
|
||||
# return text_list
|
||||
|
||||
function func:join {list:"text_list"}
|
||||
# return join.text
|
||||
|
||||
# tellraw @a {"storage":"func:temp","nbt":"join.text"}
|
||||
2
music_quiz/data/func/function/is_index.mcfunction
Normal file
2
music_quiz/data/func/function/is_index.mcfunction
Normal file
@@ -0,0 +1,2 @@
|
||||
$execute if data storage func:temp {$(l1):{$(l2):[$(index)]}} run return 1
|
||||
return 0
|
||||
2
music_quiz/data/func/function/is_space.mcfunction
Normal file
2
music_quiz/data/func/function/is_space.mcfunction
Normal file
@@ -0,0 +1,2 @@
|
||||
$execute if data storage func:temp {space:{text:"$(space)"}} run return 1
|
||||
return 0
|
||||
4
music_quiz/data/func/function/join.mcfunction
Normal file
4
music_quiz/data/func/function/join.mcfunction
Normal file
@@ -0,0 +1,4 @@
|
||||
data modify storage func:temp join.text set value ""
|
||||
$data modify storage func:temp join.list set from storage func:temp $(list)
|
||||
|
||||
function func:join/f1
|
||||
8
music_quiz/data/func/function/join/f1.mcfunction
Normal file
8
music_quiz/data/func/function/join/f1.mcfunction
Normal file
@@ -0,0 +1,8 @@
|
||||
execute store result score length func.temp run data get storage func:temp join.list
|
||||
|
||||
execute if score length func.temp matches 0 run return 1
|
||||
|
||||
data modify storage func:temp join.now set from storage func:temp join.text
|
||||
data modify storage func:temp join.next set from storage func:temp join.list[0]
|
||||
|
||||
function func:join/f2 with storage func:temp join
|
||||
5
music_quiz/data/func/function/join/f2.mcfunction
Normal file
5
music_quiz/data/func/function/join/f2.mcfunction
Normal file
@@ -0,0 +1,5 @@
|
||||
$data modify storage func:temp join.text set value "$(now)$(next)"
|
||||
|
||||
data remove storage func:temp join.list[0]
|
||||
|
||||
function func:join/f1
|
||||
5
music_quiz/data/func/function/length.mcfunction
Normal file
5
music_quiz/data/func/function/length.mcfunction
Normal file
@@ -0,0 +1,5 @@
|
||||
$data modify storage func:temp text set value "$(text)"
|
||||
|
||||
execute store result storage func:temp length int 1 run data get storage func:temp text
|
||||
|
||||
return run data get storage func:temp length
|
||||
13
music_quiz/data/func/function/num_list.mcfunction
Normal file
13
music_quiz/data/func/function/num_list.mcfunction
Normal file
@@ -0,0 +1,13 @@
|
||||
data modify storage func:temp space.space set value " "
|
||||
data modify storage func:temp zero set value 0
|
||||
$data modify storage func:temp length set value $(length)
|
||||
|
||||
execute store result score result func.temp run function func:comp_num {n1:"zero",n2:"length"}
|
||||
execute if score result func.temp matches 1 run tellraw @s {"text":"length는 1이상 이어야 합니다.","color":"red"}
|
||||
execute if score result func.temp matches 1 run return 0
|
||||
|
||||
data modify storage func:temp num_list set value []
|
||||
data modify storage func:temp index set value 0
|
||||
data modify storage func:temp index_next set value 1
|
||||
|
||||
function func:num_list/f1 with storage func:temp
|
||||
12
music_quiz/data/func/function/num_list/f1.mcfunction
Normal file
12
music_quiz/data/func/function/num_list/f1.mcfunction
Normal file
@@ -0,0 +1,12 @@
|
||||
$data modify storage func:temp space.text set string storage func:temp text $(index) $(index_next)
|
||||
execute store result score result func.temp run function func:is_space with storage func:temp space
|
||||
|
||||
$execute if score result func.temp matches 0 run data modify storage func:temp num_list append value $(index)
|
||||
|
||||
function func:plus {name:"index",plus:1}
|
||||
function func:plus {name:"index_next",plus:1}
|
||||
|
||||
execute store result score result func.temp run function func:comp_num {n1:"index",n2:"length"}
|
||||
execute if score result func.temp matches 1 run return 1
|
||||
|
||||
function func:num_list/f1 with storage func:temp
|
||||
7
music_quiz/data/func/function/plus.mcfunction
Normal file
7
music_quiz/data/func/function/plus.mcfunction
Normal file
@@ -0,0 +1,7 @@
|
||||
scoreboard objectives add func.temp dummy
|
||||
|
||||
$execute store result score temp func.temp run data get storage func:temp $(name)
|
||||
|
||||
$scoreboard players add temp func.temp $(plus)
|
||||
|
||||
$execute store result storage func:temp $(name) int 1 run scoreboard players get temp func.temp
|
||||
9
music_quiz/data/func/function/shuffle.mcfunction
Normal file
9
music_quiz/data/func/function/shuffle.mcfunction
Normal file
@@ -0,0 +1,9 @@
|
||||
scoreboard objectives add func.temp dummy
|
||||
|
||||
data modify storage func:temp shuffle.result set value []
|
||||
|
||||
$data modify storage func:temp shuffle.list set from storage func:temp $(list)
|
||||
|
||||
execute store result score length func.temp run data get storage func:temp shuffle.list
|
||||
|
||||
function func:shuffle/f1
|
||||
11
music_quiz/data/func/function/shuffle/f1.mcfunction
Normal file
11
music_quiz/data/func/function/shuffle/f1.mcfunction
Normal file
@@ -0,0 +1,11 @@
|
||||
execute store result score length func.temp run data get storage func:temp shuffle.list
|
||||
|
||||
execute if score length func.temp matches 0 run return 1
|
||||
|
||||
execute store result score random func.temp run random value 0..2147483646
|
||||
scoreboard players operation random func.temp %= length func.temp
|
||||
|
||||
execute run function func:shuffle/f2 with storage func:temp {index:0}
|
||||
|
||||
execute store result storage func:temp shuffle.index int 1 run scoreboard players get random func.temp
|
||||
function func:shuffle/f2 with storage func:temp shuffle
|
||||
4
music_quiz/data/func/function/shuffle/f2.mcfunction
Normal file
4
music_quiz/data/func/function/shuffle/f2.mcfunction
Normal file
@@ -0,0 +1,4 @@
|
||||
$data modify storage func:temp shuffle.result append from storage func:temp shuffle.list[$(index)]
|
||||
$data remove storage func:temp shuffle.list[$(index)]
|
||||
|
||||
function func:shuffle/f1
|
||||
13
music_quiz/data/func/function/text_list.mcfunction
Normal file
13
music_quiz/data/func/function/text_list.mcfunction
Normal file
@@ -0,0 +1,13 @@
|
||||
data modify storage func:temp space.space set value " "
|
||||
data modify storage func:temp zero set value 0
|
||||
$data modify storage func:temp length set value $(length)
|
||||
|
||||
execute store result score result func.temp run function func:comp_num {n1:"zero",n2:"length"}
|
||||
execute if score result func.temp matches 1 run tellraw @s {"text":"length는 1이상 이어야 합니다.","color":"red"}
|
||||
execute if score result func.temp matches 1 run return 0
|
||||
|
||||
data modify storage func:temp text_list set value []
|
||||
data modify storage func:temp index set value 0
|
||||
data modify storage func:temp index_next set value 1
|
||||
|
||||
function func:text_list/f1 with storage func:temp
|
||||
16
music_quiz/data/func/function/text_list/f1.mcfunction
Normal file
16
music_quiz/data/func/function/text_list/f1.mcfunction
Normal file
@@ -0,0 +1,16 @@
|
||||
$data modify storage func:temp space.text set string storage func:temp text $(index) $(index_next)
|
||||
execute store result score result func.temp run function func:is_space with storage func:temp space
|
||||
|
||||
$execute store result score result2 func.temp run function func:is_index {l1:"half",l2:"result",index:$(index)}
|
||||
|
||||
execute if score result2 func.temp matches 0 if score result func.temp matches 0 run data modify storage func:temp text_list append value "■"
|
||||
execute if score result2 func.temp matches 0 if score result func.temp matches 1 run data modify storage func:temp text_list append from storage func:temp space.text
|
||||
execute if score result2 func.temp matches 1 run data modify storage func:temp text_list append from storage func:temp space.text
|
||||
|
||||
function func:plus {name:"index",plus:1}
|
||||
function func:plus {name:"index_next",plus:1}
|
||||
|
||||
execute store result score result func.temp run function func:comp_num {n1:"index",n2:"length"}
|
||||
execute if score result func.temp matches 1 run return 1
|
||||
|
||||
function func:text_list/f1 with storage func:temp
|
||||
Reference in New Issue
Block a user