Skip to content

Instantly share code, notes, and snippets.

@azuax
Created August 15, 2017 04:53
Show Gist options
  • Save azuax/ea89b2cc03f9fe8df2a0b1081bc17f28 to your computer and use it in GitHub Desktop.
Save azuax/ea89b2cc03f9fe8df2a0b1081bc17f28 to your computer and use it in GitHub Desktop.
Script sencillo para resolución del desafío inzafe (2015)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
knbe@ydweaf.mb
hola@inzafe.cl
"""
dict_conv = {
'\n': '\n',
' ': ' ',
'.': '.',
'@': '@',
'a': 'f',
'b': 'l',
'd': 'n',
'e': 'a',
'f': 'e',
'g': 't', # encontrado
'i': 'u', # supuesto
'j': 'm', # encontrado
'k': 'h',
'm': 'c',
'n': 'o',
'p': 'd', # supuesto
'q': 'v', # encontrado
'r': 's', # encontrado
't': 'g', # encontrado
'u': 'p', # encontrado
'w': 'z',
'x': 'r', # encontrado
'y': 'i',
'z': 'j' # encontrado
}
texto = 'tedergf ide fqebiemynd pf\n'
texto += 'rftixypep txegiyge pf id\n'
texto += 'pye fd gi fjuxfre.\n'
texto += 'fdqye dnr id mnxxfn e\n'
texto += 'knbe@ydweaf.mb mnd fb\n'
texto += 'jfdrezf mnjubfgn\n'
texto += 'uexe\n'
texto += 'mnnxpydex\n'
texto += 'ide\n'
texto += 'qyryge pf uxfrfdgemynd.\n'
texto += 'difrgxe\n'
texto += 'uerynd fr be rftixypep.'
salida = ''
for w in texto:
if w in dict_conv:
salida += dict_conv[w]
else:
salida += '-'
print salida
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment