Translating scores to letters
So i'm working on a system to input codes through interacting signs. I've made it work well with numbers by using scores, but I'm now trying to make the same system, with letters instead of numbers, and I was wondering if there was an easy way to translating score values to their corresponding letter (0 being A, 25 being Z). The way I've made it work is as follows :
In a sign :
{"score":{"name":"$sign_1","objective":"hb_red_forest"},"click_event":{"action":"run_command","command":"/function hb_redforest:red_forest/increment_digit {score:'$sign_1'}"}}Each sign of the code (there's 4 signs) has their own score within my scoreboard (here, the score is$sign_1. The sign displays its own score, and callsincrement_digit, precising a value for the macro in the functionIn the function :
$execute if score $(score) hb_red_forest matches 10.. run scoreboard players set $(score) hb_red_forest 0 $data modify block ~ ~ ~ front_text.messages[1] set value {"score":{"name":"$(score)","objective":"hb_red_forest"},"click_event":{"action":"run_command","command":"/function hb_redforest:red_forest/increment_digit {score:'$(score)'}"}}``` When the function is called, it adds one to the sign's score, until it reaches 9, after what it goes back to 0. Each time the function is called by the sign, its content is updated with the new score So I wanted to do something similar, but using letters, and the only way I'm seeing how to do that is to write something like ``execute if score $sign_letter1 hb_red_forest matches 0 run data modify block ~ ~ ~ front_text.message[1] set value {"text":"A"}`` and so on for all 26 letters, but I don't find that particularly aesthetic, and I'm not even sure it'd work well Does anyone have any idea how I could make this work?