Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Cipher Map by mfrankowski
def checkio(c):
e=[]
for i in range(4):
w=""
for j in range(4):
w=w+c[3-j][i]
e.append(w)
return e
def recall_password(cipher_grille, ciphered_password):
w=""
for k in range(4):
for i in range(4):
for j in range(4):
if cipher_grille[i][j]=="X":
w=w+ciphered_password[i][j]
cipher_grille=checkio(cipher_grille)
return w
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. 20, 2016