🎉 Initial commit
This commit is contained in:
14
data/code/shadok.py
Normal file
14
data/code/shadok.py
Normal 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
|
||||
Reference in New Issue
Block a user