Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Cipher Map by krzysztof.gonda
def recall_password(cipher_grille, ciphered_password):
wynik = ''
arr1 = ''
arr2 = ''
arr3 = ''
arr4 = ''
for z in range(0,4):
arr1 = ''
arr2 = ''
arr3 = ''
arr4 = ''
if(z!=0):
arr1+=cipher_grille[3][0]
arr1+=cipher_grille[2][0]
arr1+=cipher_grille[1][0]
arr1+=cipher_grille[0][0]
arr2+=cipher_grille[3][1]
arr2+=cipher_grille[2][1]
arr2+=cipher_grille[1][1]
arr2+=cipher_grille[0][1]
arr3+=cipher_grille[3][2]
arr3+=cipher_grille[2][2]
arr3+=cipher_grille[1][2]
arr3+=cipher_grille[0][2]
arr4+=cipher_grille[3][3]
arr4+=cipher_grille[2][3]
arr4+=cipher_grille[1][3]
arr4+=cipher_grille[0][3]
cipher_grille=(arr1,arr2,arr3,arr4)
for x in range(0,4):
for y in range(0,4):
if(cipher_grille[x][y]=='X'):
wynik+=ciphered_password[x][y]
return wynik
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. 18, 2017