ololololo > 02-08-2026, 03:40 PM
ololololo > 03-08-2026, 04:25 PM
ololololo > 07-08-2026, 04:29 PM
ololololo > 08-08-2026, 12:31 PM

JoJo_Jost > 08-08-2026, 12:58 PM
ololololo > 08-08-2026, 01:47 PM
(08-08-2026, 12:58 PM)JoJo_Jost Wrote: You are not allowed to view links. Register or Login to view.that ist normal... u find this in other languages, tooWhich ones?
ololololo > 08-08-2026, 10:31 PM
import random
def letter_to_num(letter):
letter = letter.upper()
if letter == 'J':
return None
if letter in ['U', 'V']:
return 20
if 'A' <= letter < 'J':
return ord(letter) - ord('A') + 1
if 'K' <= letter <= 'Z':
return ord(letter) - ord('A')
return None
def num_to_roman_tokens(num):
tokens = []
roman_rules = [
(22, 'XXII'), (21, 'XXI'), (20, 'XX'), (19, 'XIX'),
(18, 'XVIII'), (17, 'XVII'), (16, 'XVI'), (15, 'XV'),
(14, 'XIV'), (13, 'XIII'), (12, 'XII'), (11, 'XI'),
(10, 'X'), (9, 'IX'), (8, 'VIII'), (7, 'VII'),
(6, 'VI'), (5, 'V'), (4, 'IV'), (3, 'III'),
(2, 'II'), (1, 'I')
]
for val, sym in roman_rules:
while num >= val:
tokens.append(sym)
num -= val
return tokens
def encrypt_word(word):
numbers = [letter_to_num(l) for l in word if letter_to_num(l) is not None]
if not numbers:
return word
numbers.sort(reverse=True)
raw_tokens = []
for num in numbers:
raw_tokens.extend(num_to_roman_tokens(num))
separate_last_i = False
if len(raw_tokens) >= 2 and raw_tokens[-2] == 'III' and raw_tokens[-1] == 'I':
separate_last_i = True
raw_tokens.pop()
encrypted_tokens = []
is_standalone_xx = len(raw_tokens) == 1 and raw_tokens[0] == 'XX'
i = 0
while i < len(raw_tokens):
token = raw_tokens[i]
if token == 'XV' and i + 1 < len(raw_tokens) and raw_tokens[i+1] == 'XV':
encrypted_tokens.append("che")
i += 2
continue
if token == 'XVI':
if i + 1 < len(raw_tokens):
next_token = raw_tokens[i+1]
if next_token.startswith('XV') or next_token.startswith('X') or next_token.startswith('V'):
if next_token == 'XV':
encrypted_tokens.append("q")
i += 2
continue
else:
encrypted_tokens.append("qo")
i += 1
continue
encrypted_tokens.append("s")
i += 1
continue
if token == 'XXII': encrypted_tokens.append("chol")
elif token == 'XXI': encrypted_tokens.append("chor")
elif token == 'XIX':
prefix = random.choices(["ch", "yt", "yk"], weights=[60, 20, 20])[0]
encrypted_tokens.append(f"{prefix}eor")
elif token == 'XVIII': encrypted_tokens.append("oiin")
elif token == 'XVII': encrypted_tokens.append("cph")
elif token == 'XX': encrypted_tokens.append("sh" if is_standalone_xx else "ch")
elif token == 'XV': encrypted_tokens.append("o")
elif token == 'XIV': encrypted_tokens.append("oke")
elif token == 'XIII': encrypted_tokens.append("daiin")
elif token == 'XII': encrypted_tokens.append("dan")
elif token == 'XI': encrypted_tokens.append("ey")
elif token == 'IX':
base = random.choices(["or", "ol"], weights=[60, 40])[0]
prefix = random.choices(["ch", "yk", "yt"], weights=[80, 10, 10])[0]
encrypted_tokens.append(f"{prefix}{base}")
elif token == 'VIII': encrypted_tokens.append("aiin")
elif token == 'VII': encrypted_tokens.append("ain")
elif token == 'VI': encrypted_tokens.append("an")
elif token == 'IV': encrypted_tokens.append("ok")
elif token == 'X': encrypted_tokens.append("e")
elif token == 'V': encrypted_tokens.append("a")
elif token == 'III': encrypted_tokens.append("iin")
elif token == 'II': encrypted_tokens.append("in")
elif token == 'I':
current_word_str = "".join(encrypted_tokens)
if current_word_str and current_word_str[-1] in ['a', 'o']:
encrypted_tokens.append("n")
else:
encrypted_tokens.append("y")
i += 1
# Объединение ok/ot, a, in/iin в okaiin/otaiin
has_ok_ot = None
ok_ot_idx = -1
for idx, t in enumerate(encrypted_tokens):
if t in ["ok", "oke"]:
has_ok_ot = "ok"
ok_ot_idx = idx
break
elif t == "ot":
has_ok_ot = "ot"
ok_ot_idx = idx
break
a_idx = encrypted_tokens.index("a") if "a" in encrypted_tokens else -1
in_idx = -1
for idx, t in enumerate(encrypted_tokens):
if t in ["in", "iin"]:
in_idx = idx
break
if ok_ot_idx != -1 and a_idx != -1 and in_idx != -1:
combined = f"{has_ok_ot}aiin"
indices = sorted([ok_ot_idx, a_idx, in_idx], reverse=True)
first_idx = indices[-1]
for idx in indices:
encrypted_tokens.pop(idx)
encrypted_tokens.insert(first_idx, combined)
if separate_last_i:
current_word_str = "".join(encrypted_tokens)
last_i_char = "n" if current_word_str and current_word_str[-1] in ['a', 'o'] else "y"
encrypted_tokens.append(last_i_char)
if encrypted_tokens and encrypted_tokens[-1] == "n":
encrypted_tokens[-1] = "y"
if len(encrypted_tokens) >= 2 and encrypted_tokens[-2] == "a" and encrypted_tokens[-1] == "y":
encrypted_tokens[-2] = "d"
if encrypted_tokens:
if encrypted_tokens[-1] == "a":
encrypted_tokens[-1] = "g"
elif encrypted_tokens[-1].endswith("a"):
encrypted_tokens[-1] = encrypted_tokens[-1][:-1] + "g"
encrypted_str = " ".join(encrypted_tokens)
return encrypted_str
def encrypt_text(text):
words = text.split()
encrypted_words = [encrypt_word(w) for w in words]
return " /// ".join(encrypted_words)
print(encrypt_text("OO"))
print(encrypt_text("PE"))
print(encrypt_text("PO"))
my_text = "YOUR TEXT"
print(encrypt_text(my_text))bi3mw > 08-08-2026, 10:39 PM
bi3mw > 09-08-2026, 11:46 AM