Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
newbie solution in Clear category for Cipher Map by ewa_c
def recall_password(cipher_grille, ciphered_password):
result = ""
for n in range(4):
for m in range(4):
if cipher_grille[n][m]=='X':
result += ciphered_password[n][m]
x = 0
for n in [0,1,2,3]:
y=0
for m in [3,2,1,0]:
if cipher_grille[m][n]=='X':
result += ciphered_password[x][y]
y+=1
x+=1
x = 0
for n in [3,2,1,0]:
y=0
for m in [3,2,1,0]:
if cipher_grille[n][m]=='X':
result += ciphered_password[x][y]
y+=1
x+=1
x = 0
for n in [3,2,1,0]:
y=0
for m in [0,1,2,3]:
if cipher_grille[m][n]=='X':
result += ciphered_password[x][y]
y+=1
x+=1
return result
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. 29, 2016