glogglog

python challenge(15-21)


level15:

pretty easy, 1\d{1,2}6 year jananry 26th is a Monday.

whom? use wikipedia

http://www.pythonchallenge.com/pc/return/mozart.html


level16:

shift each line to make the purple bars as one stick?

five 195

http://www.pythonchallenge.com/pc/return/romance.html


level17:

in level4, a cookie is set:

info=you+should+have+followed+busynothing...

start chain with busynothing=12345 and collect all cookies

BZh hint decompressing

'is it the 26th already? call his father and inform him that "the flowers are on their way". he\'ll understand.'

mozart's father is Leopold, use phonebook.phone('Leopold') in level13 I got

http://www.pythonchallenge.com/pc/return/violin.html

request http://www.pythonchallenge.com/pc/stuff/violin.php with cookie "info=the%20flowers%20are%20on%20their%20way"

oh well, don't you dare to forget the balloons.

http://www.pythonchallenge.com/pc/return/balloons.html


level18:

the difference is brightness.html

difflib.ndiff() lines in delta.txt, and write to each of '-', '+', ' ' to file. they are png image.

http://butter:fly@www.pythonchallenge.com/pc/hex/bin.html


level19:

computer is out of order, byteorder is reversed. So byteswap bytes in indian.wav's frames.

http://www.pythonchallenge.com/pc/hex/idiot.html

http://www.pythonchallenge.com/pc/hex/idiot2.html


level20:

Content-Range is:  bytes 0-30202/2123456789

add request header "range bytes=30202-30202", got:

---------------------------------------------------------------

Why don't you respect my privacy?
we can go on in this way for really long time.
stop this!
invader! invader!
ok, invader. you are inside now.
---------------------------------------------------------------

from back to front, add request header "range bytes=2123456789-2123456789", got:

esrever ni emankcin wen ruoy si drowssap eht

the password is your new nickname in reverse.

and it is hiding at 1152983631.

at 1152983631: got a zip file encrypted

the password is redavni

we are in level 21


level21:

file starts with 78 9c is zlib compressed file.

repeating decompress it with zlib or bz2 until get error, see the tail of decompressing result, it's 9c 78

"look at your logs"

log our action, mark zlib decompressing as "x", bz2 decompressing as "B", mark reverse as "\n"

http://www.pythonchallenge.com/pc/hex/copper.html



python challenge(8-14)

level8:

the un and pw startswith 'BZh', which is magic number of a bz2 file, so you use bz2 module:

bz2.decompress

http://www.pythonchallenge.com/pc/return/good.html


level9:

first and second is coordinations of pots.

use ImageDraw.polygon([first],fill=color)

I first tried gnu, then cow, at last bull

http://www.pythonchallenge.com/pc/return/bull.html


level10:

len(a[30]) = ?

a = [1, 11, 21, 1211, 111221, 

the next item is the description of previous item
11 is one 1
21 is two 1
1211 is one two, one one
111221 is one one, one two, two one

http://www.pythonchallenge.com/pc/return/5808.html

level11:

http://bg5hfc.spaces.live.com/blog/cns!E67CCF4FFB0BE86!1147.entry

I still have no idea how they get the way.

http://www.pythonchallenge.com/pc/return/evil.html


level12:

evil2.jpg-->evil2.gfx

dispatch this file to five file, you'll get the word by "file" them.

http://www.pythonchallenge.com/pc/return/disproportional.html


level13:

xml-rpc phonebook.php listMethods

555-ITALY

try -- 555-48259 55548259 ITALY italy

http://www.pythonchallenge.com/pc/return/italy.html


level14:

wire.png is a 10000*1 image, convert to 100*100?

consider

remember: 100*100 = (100+99+99+98) + (...

and title of this level "walk around"

source below:

import Image

def turn():
global fl,fi,f
fi=(fi+1)%4
f=fl[fi]

src = Image.open('wire.png')
des = Image.new('RGB', (100,100))

# direction functions
r = lambda (x,y):(x+1,y)
d = lambda (x,y):(x,y+1)
l = lambda (x,y):(x-1,y)
u = lambda (x,y):(x,y-1)

# direction functions list
fl = [r,d,l,u]

# current direction function index
fi = 0

# current direction function
f=r

# current postion
pos = (-1,0)

index = -1
for i in range(100):
index += 1
pos = f(pos)
des.putpixel(pos,src.getpixel((index,0)))


for i in range(99,0,-1):
for m in range(2):
turn()
for k in range(i):
index += 1
pos = f(pos)
des.putpixel(pos,src.getpixel((index,0)))

des.save('cat.png')

http://www.pythonchallenge.com/pc/return/cat.html

 

 

 



start my python challenge(1-7)

 

Hi, I start to play www.pythonchallenge.com, I'll post answers here and source at my source repository.


level0:

2**38

http://www.pythonchallenge.com/pc/def/274877906944.html


level1:

string.translate('map',''.join(chr((i+2)%256) for i in range(256)))

http://www.pythonchallenge.com/pc/def/ocr.html


level2:

get the rare letters and rearrange to a word

http://www.pythonchallenge.com/pc/def/equality.html


level3:

[k[4] for k in re.findall('[a-z][A-Z]{3}[a-z][A-Z]{3}[a-z]',s,re.M)]

http://www.pythonchallenge.com/pc/def/linkedlist.html


level4:

12345

50010

53522

92118

46059

http://www.pythonchallenge.com/pc/def/peak.html


level5:

pickle banner.p

and print them

http://www.pythonchallenge.com/pc/def/channel.html


level6:

http://www.pythonchallenge.com/pc/def/channel.zip

zipfile.ZipFile.infolist comment

http://www.pythonchallenge.com/pc/def/hockey.html

http://www.pythonchallenge.com/pc/def/oxygen.html


level7:

use PIL to pick pixel from that image.

coordinate is (i*7, 42)

got RGB and chr() to:

smart guy, you made it. the next level is [105, 110, 116, 101, 103, 114, 105, 116, 121]

chr() again

http://www.pythonchallenge.com/pc/def/integrity.html


 

 



sevenever@gmail.com
Copyright © 2008. All rights reserved.