Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
zip() solution in Speedy category for Cipher Map by EmberQuill
def recall_password(cipher_grille, ciphered_password):
password = ''
for _ in range(4):
password += ''.join([x for x, y in zip(''.join(ciphered_password), ''.join(cipher_grille)) if y == 'X'])
cipher_grille = [''.join(x) for x in zip(*cipher_grille[::-1])]
return password
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'
April 8, 2017