Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Cipher Map by wojtek96
def obrot(gril):
tab=['','','','']
for r in range(4):
for c in range(4):
tab[r] = tab[r] + (gril[3-c][r])
return tab
def recall_password(grille, password):
grille = list(grille)
sms = ""
for m in range(4):
for i in range(4):
for j in range(4):
if grille[i][j] == "X":
sms = sms + password[i][j]
grille = obrot(grille)
return sms
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. 15, 2016