🎉 Initial commit

This commit is contained in:
docusland
2024-10-07 10:17:49 +02:00
commit b97050303f
8 changed files with 18707 additions and 0 deletions

14
data/code/shadok.py Normal file
View File

@@ -0,0 +1,14 @@
SHADOK_CONVERSION = {"GA": 0, "BU": 1, "ZO": 2, "MEU": 3}
def translate_shadok_number_to_human_number(message: str) -> int:
"""
Translate a shadok number to human readable number.
example : BU MEU ZO MEU GA GA -> 1968
:param message:
:return:
"""
words = message.split()[::-1]
result = 0
for i, word in enumerate(words):
result += SHADOK_CONVERSION[word] * pow(4, i)
return result