Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
7 lines proc solution in Clear category for Rotating Grille Cipher by CDG.Axel
def grille_encrypt(plaintext: str, grille, unite=''.join):
res, text, part = '', list(plaintext), [''] * 16
while text and unite(grille).count('X') == 4:
for _ in range(4):
part = [text.pop(0) if e == 'X' else part[i] for i, e in enumerate(unite(grille))]
grille = [*map(unite, zip(*grille[::-1]))]
res += unite(part)
return res if len(plaintext) == len(res) else None
Dec. 16, 2021
Comments: