I am trying to create a program that prints out ascii images from their respective external text files, The problem is the message has to be decrypted by shifting the characters to the left on the Ascii chart first,
def decrypt(cipherText, key):
""" Decode a message by shifting characters to the left on the ASCII chart. """
plainText = ""
for character in cipherText:
cipherValue = ord(character)
ordValue = cipherValue - key
plainText += chr(ordValue)
return plainText
def main():
if __name__ == "__main__":
main()
sample of printed text file below(should print out toy story ascii image)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!/;;;;;;;;;/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!/;;;;;;;;;;;;;;;/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;;;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;!!a;;;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!!!!!!!!!!;;!?/!a;;;;;;;;;;;;;;;(((!!/;;!!!!!!!!!!!!!!!!!!!!!!!!!!!!;;!a=D?-//aaaaaaaa///!!!/;;((!!!!!!!!!!!!!!!!!!!!!!!!!!!!a;;;//aa===DDD???((//;;;((/!!!!!!!!!!!!!!!!!!!/-d%%i/!!!!a(;;;;;;/////;;;((((/-d%%M!!!!!!!!!!!!!!!!!!K%%%%%/@/!-e%>!!aaaaa/-!!!/{dd%%%%%%%%/!!!!!!!!!!!!!!!!-%%%%%%%G/#5Q#/;a;;!-%%#/;;;/!#%%%%%%%%%i!!!-dd-!!!!!!!!!!!!!!!-%%%%%Q#/-Q/#!((-d!a-e%%!a(aa(;/a%%%%%%%%%i!>#4%%d/!!!!!!!!!!!!!!/%%%%%G!%%#!ed!.@##@!@%%(-d%%d!!a!@%%%%%%%%G-!e%%%%i/!!!!!!!!!!!!!!K%%%%%%!%G!-%(-##%%i/@%(----/##!/!a%%%%%%%%!e!4%%%%%%/!!!!!!!!!!!!!!4%%%%%Q!%G!%%!!!!@%%(K(-%#!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iuuqt;00btdjjbsu/xfctjuf0Uijt!BTDJJ!qjd!dbo!cf!gpvoe!buiuuqt;00btdjjbsu/xfctjuf0joefy/qiq@bsu>npwjft0upz&31tupsz
`