pythonchallenge Level 14

第14关地址:http://www.pythonchallenge.com/pc/return/italy.html

账号:huge 密码:file

pythonchallenge Level 14

一个逆时针螺旋面包,下方还有一张小图

查看源码,标题是walk around

提示信息:remember: 100*100 = (100+99+99+98) + (...  

pythonchallenge Level 14

 

wire.png 刚好是100*100,也就是要把wire.png的像素点重排,按照逆时针一圈一圈排列

from PIL import Image

img = Image.open('wire.png')
print(img.size) # (10000, 1)
newImg = Image.new(img.mode,(100,100))

x0,y,num = 0,0,0
while x0 < 10000:
    for x in range(num,100-num):
        newImg.putpixel((x, y), img.getpixel((x0, 0)))
        x0 += 1
    for y in range(num,99-num):
        newImg.putpixel((x, y), img.getpixel((x0, 0)))
        x0 += 1
    for x in range(99-num,num,-1):
        newImg.putpixel((x, y), img.getpixel((x0, 0)))
        x0 += 1
    for y in range(98-num,num,-1):
        newImg.putpixel((x, y), img.getpixel((x0, 0)))
        x0 += 1
    num += 1
newImg.save("newImg14.png")

pythonchallenge Level 14

 

得到一只猫,打开http://www.pythonchallenge.com/pc/return/cat.html

pythonchallenge Level 14

 

得到提示信息:and its name is uzi. you'll hear from him later.

获得下一关地址:http://www.pythonchallenge.com/pc/return/uzi.html

上一篇:DataFrame.droplevel


下一篇:车来了赵祺:贴近业务,是DT时代第一驱动力