Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Speedy category for Cipher Map by piemar1
def recall_password(cipher_grille, ciphered_password):
results = []
for n in range(4):
for n_row, row in enumerate(cipher_grille):
for n_pos, position in enumerate(row):
if position == 'X':
results.append(ciphered_password[n_row][n_pos])
cipher_grille = list(zip(*cipher_grille[::-1]))
return "".join(results)
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'
Nov. 24, 2016