I am making a function to display the sokoban level as custom emojis, but in the lvl.replace("#", w), it says that it can't access local var, somebody pls help?
def display_lvl_as_emoji(lvl, emoji) -> str:
match emoji:
case 0x5865F2: w = ":wall_veasy:"
case 0x57F287: w = ":wall_easy:"
case 0xF1C40F: w = ":wall_med:"
case 0xED4245: w = ":wall_med2:"
case _: ":wall_med:"
lvl = lvl.replace("#", w)
lvl = lvl.replace("@", ":player:")
lvl = lvl.replace("+", ":playerflush:")
lvl = lvl.replace("$", ":box:")
lvl = lvl.replace("*", ":box2:")
lvl = lvl.replace(" ", ":floor:")
lvl = lvl.replace(".", ":floor2:")
return lvl
also because of discord formatting the emojis is not in brackets properly