Created
January 19, 2009 19:10
-
-
Save wacotaqo/49112 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Python Challenge #1 | |
| =================== | |
| http://www.pythonchallenge.com/pc/def/map.html | |
| Image: Notebook K-->M, O-->Q, E-->G | |
| Caption: everybody thinks twice before solving this. | |
| Note: g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj. | |
| General tips: | |
| Use the hints. They are helpful, most of the times. | |
| Investigate the data given to you. | |
| Avoid looking for spoilers. | |
| Forums: Python Challenge Forums | |
| SOLUTION: | |
| Characters need to be decoded to ord(<character>)+2 | |
| I did it bruteforce as follows: | |
| def decode(c): | |
| if c.isalpha(): | |
| o = ord(c)+2 | |
| if o > ord('z'): o = o-ord('z')+ord('a')-1 | |
| return chr(o) | |
| else: | |
| return c | |
| text = """g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.""" | |
| ''.join([decode(c) for c in text]) | |
| Gives ==> | |
| "i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url." | |
| Haha... | |
| Applying to the URL helps only if you apply to 'map', which gives 'ocr' | |
| New URL: | |
| http://www.pythonchallenge.com/pc/def/ocr.html | |
| Funny: If you apply to to 'map.html' you get 'ocr.jvon' and that generates a funny response. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment