Skip to content

Instantly share code, notes, and snippets.

@mov-ebx
Created April 16, 2023 00:37
Show Gist options
  • Save mov-ebx/949d777566ef497706bbf55946e97266 to your computer and use it in GitHub Desktop.
Save mov-ebx/949d777566ef497706bbf55946e97266 to your computer and use it in GitHub Desktop.
2 letter country code ➡️ emoji in LUA
local CountryCode = "US" -- Example country code, must be 2 letters
local Emoji = ""
-- Regional indicator emojis
local RegionalIndicators = {A="🇦",B="🇧",C="🇨",D="🇩",E="🇪",F="🇫",G="🇬",H="🇭",I="🇮",J="🇯",K="🇰",L="🇱",M="🇲",N="🇳",O="🇴",P="🇵",Q="🇶",R="🇷",S="🇸",T="🇹",U="🇺",V="🇻",W="🇼",X="🇽",Y="🇾",Z="🇿"}
-- Loop through letters in country code
for c in CountryCode:gmatch"." do
Emoji = Emoji..RegionalIndicators[c]
end
-- Output emoji
print(Emoji)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment