Python Challenge level 14: “walk around”
Level 14 is really short once again.
Hint 1: image is a spiral. It’s direction could be meaningful
Hint 2: remember: 100*100 = (100+99+99+98) + …. (3+2+2+1)+1
Fact 1: wire.jpg is 1×10000 pixels = 100*100
I especially liked this level because it was straight forward. You didn’t have to imagine obscure meanings hidden in the hints. The wire.jpg is so streched that it resembles a barcode, so you can automatically know that there is something encoded somehow. Also the 100*100 sequence hint, and the 100*100 pixels couldn’t be clearer. I think it is the first level I solved in under 5 minutes since the easy ones at the beginning of the game.
#!/usr/bin/env python
import Image
im = Image.open("wire.png")
new = Image.new(im.mode,[100,100])
doubled_steps=200
directions=[(1,0), (0,1), (-1,0), (0,-1)] # vectors in [x,y] format
x,y,p=-1,0,0
while doubled_steps//2 > 0:
for v in directions: # we will be taking steps in 4 directions
steps=doubled_steps//2
for s in range(steps):
x,y=x+v[0],y+v[1]
new.putpixel((x,y),im.getpixel((p,0)))
p+=1
doubled_steps-=1
new.save('14.jpg')
It’s a cat. We’ll learn its name in cat.html as well as the place to go if we’re looking for Level 15.