Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Creative category for Cipher Map by panaro32
def recall_password(c,m):
f = lambda x,y: [(0,x,y),(1,y,3-x),(2,3-x,3-y),(3,3-y,x)]
l = [f(i,j) for i in range(4) for j in range(4) if c[i][j]=='X']
return ''.join(m[x][y] for _,x,y in sorted(sum(l,[])))
if __name__ == '__main__':
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'
June 24, 2014
Comments: