Posted in September 15, 2007 ¬ 09:31h.Taher Shihadeh
Level 9 needs some more drawing. Hint 1: first+second=? import Image,ImageDraw im = Image.new(‘RGB’, (500,500)) draw = ImageDraw.Draw(im) first=[146,399,163,403, ...] # chunked second=[156,141,165,135, ...] # chunked for i in range(0, len(first), 2): draw.line(first[i:i + 4], fill=’white’) for i in range(0, len(second), 2): draw.line(second[i:i + 4], fill=’white’) im.save(’09.jpg’) Is it a cow? Nope, it’s Level 10. [...]
Read the rest of this entry »
Posted in September 14, 2007 ¬ 00:10h.Taher Shihadeh
Level 8 is easy. Hint 1: Where is the missing link? Hint 2: un and pn are provided Fact 1: the bee links to a page in a protected directory Fact 2: BZh91AY seems to be a bzip2 header (says Google) import bz2 un= ‘BZh91AY&SYAx….’ #complete the string here pw= ‘BZh91AY&SYx9….’ #likewise print “user:”,bz2.decompress(un) print [...]
Read the rest of this entry »
Posted in September 13, 2007 ¬ 00:01h.Taher Shihadeh
Level 7 needs the Image module. Fact 1: The PNG file has a weird grey area, so the information must be encoded there. import Image im = Image.open(“oxygen.png”) print “Image info:”,im.format, im.size, im.mode #we’ll limit the grey zone y_begin = 0 while True: p = im.getpixel((0, y_begin)) if p[0] == p[1] == p[2]: break y_begin [...]
Read the rest of this entry »
Posted in September 12, 2007 ¬ 00:10h.Taher Shihadeh
Level 6 deals again with linked lists. Hint 1: Image is a zipper and there is a comment in the page (<!– <– zip –>). Once we open channel.zip, there are some more hints: “welcome to my zipped list“. Hint 2: start from 90052 Hint 3: answer is inside the zip import zipfile,re idx=”90052″ file [...]
Read the rest of this entry »
Posted in September 11, 2007 ¬ 00:29h.Taher Shihadeh
Level 5 is the first challenge specific to Python since it involves the pickle module in charge of Python object serialization. Hint 1: pronounce it Fact 1: there is a refference to a file named banner.p in the html source, so we’ll download it and see Fact 2: once depickled, it looks like a run-length [...]
Read the rest of this entry »
Posted in September 10, 2007 ¬ 08:09h.Taher Shihadeh
Level 4 requires some web scraping. Nice :) Hint 1: urllib may help. DON’T TRY ALL NOTHINGS, since it will never end. 400 times is more than enough Hint 2: linkedlist.php?nothing=12345 import urllib,re url=’http://www.pythonchallenge.com/pc/def/ linkedlist.php?nothing=’ seed=”12345″ for i in range(400): text=urllib.urlopen(url+seed).read() seed=”".join(re.findall(r”nothing is (\d+)”,text)) try : int(seed) print ” Next:”,seed except : print ” Last:”,text [...]
Read the rest of this entry »
Posted in September 9, 2007 ¬ 00:40h.Taher Shihadeh
Level 3 is the last of these initial text processing problems. Everything quite easy for now. Hint 1: One small letter, surrounded by EXACTLY three big bodyguards on each of its sides. #!/usr/bin/env python import re mess = open(“03.txt”).read() print ”.join(re.findall(‘[^A-Z][A-Z]{3}([a-z])[A-Z]{3}[^A-Z]‘, mess)) linkedlist From linkedlist.html we’re sent to linkedlist.php, and up to Level 4.
Read the rest of this entry »
Posted in September 8, 2007 ¬ 11:51h.Taher Shihadeh
Hint 1: recognize the characters. maybe they are in the book, but MAYBE they are in the page source. Hint 2: find rare characters in the mess below (this hint is found looking at the source, and I stored it in file 02.txt for convinience). Looking for clues in whatever information you get will become [...]
Read the rest of this entry »
Posted in September 7, 2007 ¬ 16:38h.Taher Shihadeh
Level 1 gets a bit more interesting. Hint 1: k->m, o->q, e->g import string src = string.lowercase[:26] dst = string.lowercase[2:26] + ‘ab’ trans = string.maketrans(src, dst) 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 [...]
Read the rest of this entry »
Posted in September 7, 2007 ¬ 16:36h.Taher Shihadeh
I recently discovered the Python Challenge web site. An interesting way to pick up a programming language. It claims to be the first programming riddle on the net, and I have been told that it’s shaped after another onlin games that predates this one by more than a year, notprOn. It turns out the Python [...]
Read the rest of this entry »