Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Creative category for Cipher Map by frbrgeorge
def recall_password(cipher_grille, ciphered_password):
return "".join([ciphered_password[y][x] for f in (lambda j,i: (j,i), lambda j,i: (i,-j-1), lambda j,i: (-j-1,-i-1), lambda j,i: (-i-1,j)) for y,x in sorted(f(Y,X) for Y,s in enumerate(cipher_grille) for X,c in enumerate(s) if c=="X")])
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert recall_password(
('X...',
'..X.',
'X..X',
'....'),
('itdf',
'gdce',
'aton',
'qrdi')) == 'icantforgetiddqd', 'First example'
assert recall_password(
('....',
'X..X',
'.X..',
'...X'),
('xhwc',
'rsqx',
'xqzz',
'fyzr')) == 'rxqrwsfzxqxzhczy', 'Second example'
Dec. 22, 2018