python3
kann nur cäsar und kann nur eingegebenen string ver-/entschlüsseln. habe vor, dateien vielleicht in den nächsten tagen noch ein zu bauen.
Code:
def encode(char, str):
clear = "abcdefghijklmnopqrstuvwxyz"
cryptic = clear[clear.index(char):] + clear[:clear.index(char)]
crystr = ""
str = str.lower()
for i in str:
if i not in clear:
new = i
else:
new = cryptic[clear.index(i)]
crystr = crystr + new
return crystr
def decode(char, str):
clear = "abcdefghijklmnopqrstuvwxyz"
cryptic = clear[clear.index(char):] + clear[:clear.index(char)]
enstr = ""
str = str.lower()
for i in str:
if i not in cryptic:
new = i
else:
new = clear[cryptic.index(i)]
enstr = enstr + new
return enstr