Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Cipher map solution in Clear category for Cipher Map by graffme
def read_tuple(map, symbols):
password = ""
for i in range(4):
for j in range(4):
if map[i][j] == "X":
password = password + symbols[i][j]
return password
def turn_tuple(map):
list = []
for i in range(4):
str = ""
for j in range(4):
str = map[j][i] + str
list.append(str)
newTuple = tuple(list)
return newTuple
def recall_password(cipher_grille, ciphered_password):
#iteruj po tuplu grille szukając X - zapamiętaj współrzędne i odczytaj dla nich literę z tupla password
#stwórz funkcję generującą obruconego tupla
#iteruj po nowym tuplu
password0 = read_tuple(cipher_grille, ciphered_password)
newTuple0 = turn_tuple(cipher_grille)
password1 = read_tuple(newTuple0, ciphered_password)
newTuple1 = turn_tuple(newTuple0)
password2 = read_tuple(newTuple1, ciphered_password)
newTuple2 = turn_tuple(newTuple1)
password3 = read_tuple(newTuple2, ciphered_password)
finalPassword = password0 + password1 + password2 + password3
return finalPassword
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'
Jan. 11, 2017