Going back to the original question by TS, this is an
attempt to reduce the number of possibilities generated by the "brute force" method.
It assumes plain text, so likely there are spaces between the words.
I believe it will solve all Cesars, generated with this key in any language (that uses these symbols).
I have replaced the symbols not found by '?' and changed the indexing system so i could do try-except.
Next person to do a Cesar should use the alternate symbols list, that I was able to format correctly
with the help of other posters here.
Paul
attempt to reduce the number of possibilities generated by the "brute force" method.
It assumes plain text, so likely there are spaces between the words.
I believe it will solve all Cesars, generated with this key in any language (that uses these symbols).
I have replaced the symbols not found by '?' and changed the indexing system so i could do try-except.
Next person to do a Cesar should use the alternate symbols list, that I was able to format correctly
with the help of other posters here.

Paul
# import string thelist = ["qeFIP?eGSeECNNS,", "5coOMXXcoPSZIWoQI,", "avnl1olyD4l'ylDohww6DhzDjhuDil,", "z.GM?.cEQc. 70c.7KcKMKHA9AGFK,", "?MFYp2pPJJUpZSIJWpRdpMFY,", "ZqH8sl5HtqHTH4s3lyvH5zH5spH4t pHzqHlH3l5K", "Zfbi,!tif!xpvme!qspcbcmz!fbu!nfA"] # SYMBOLS = f"{string.ascii_letters}{string.digits}{string.punctuation} " # add space SYMBOLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 !?.' def newindex(letter, shft): try: idxnew = SYMBOLS.index(letter) + shft if idxnew >= len(SYMBOLS): idxnew = idxnew - len(SYMBOLS) return SYMBOLS[idxnew] except: return '?' idxspace = SYMBOLS.index(' ') textline = '' for line in thelist: letterIndex = 0 IcanReadIt = False while not IcanReadIt: try: shft = idxspace - SYMBOLS.index(line[letterIndex]) for letter in line: textline += newindex(letter, shft) print(f'> > > > > > > > > > > > > {textline}') answ = input('Can you read this ? (y/n) ') if answ.lower() == 'y': IcanReadIt = True textline = '' except: textline += '?' letterIndex += 1
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.