Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in 3rd party category for Cipher Map by Geovanna_M_Gomez
import numpy as np
def recall_password(cipher_grille, ciphered_password):
l=[]
L=[]
contraseña=''
for elemento in cipher_grille:
l.append(list(elemento))
matrizreglilla= np.array(l)
for elemento in ciphered_password:
L.append(list(elemento))
matrizcontraseña= np.array(L)
matrizreglilla= matrizreglilla!='.'
for i in range(4):
contraseña += ''.join(list(matrizcontraseña[matrizreglilla]))
matrizreglilla= np.rot90(matrizreglilla,3)
return contraseña
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'
Jan. 12, 2017
Comments: