Differences

This shows you the differences between two versions of the page.

programiranje:python_challenge:nivo_7 [2009/11/23 09:06] (current)
delboy created
Line 1: Line 1:
 +===== Python Challenge - Nivo 7 =====
 +U [[http://www.pythonchallenge.com/pc/def/oxygen.html|ovom nivou]] nisam našao nikakvo uputstvo. Na slici koja je data postoji jedna linija sa nijansama sive boje ( //oxygen.png//). Sa malo istraživanja u [[http://en.wikipedia.org/wiki/GIMP|gimpu]] lako je naći koordinate tih boja. Pošto RGB komponente za sive boje imaju iste vrednosti probao sam ih pretvoriti u karaktere i dobio sam text.
 +
 +U sklopu texta koji se dobije nalazi se i jedna lista i ako se na nju primeni isto pretvaranje u karaktere dobije se rešenje.
 +
 +<code python>
 +from PIL import Image
 +
 +file = 'oxygen.png'
 +
 +im = Image.open(file)
 +
 +print "".join([chr(im.getpixel((x, 45))[0]) for x in xrange(0, im.size[0] - 25, 7)])
 +
 +# previous code gives
 +# smart guy, you made it. the next level is [105, 110, 116, 101, 103, 114, 105, 116, 121]
 +# so, we need to decode given list
 +lst = [105, 110, 116, 101, 103, 114, 105, 116, 121]
 +
 +print "".join([chr(x) for x in lst])
 +</code>
 +
 +**Rešenje**: http://www.pythonchallenge.com/pc/def/integrity.html
 
programiranje/python_challenge/nivo_7.txt · Last modified: 2009/11/23 09:06 by delboy
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki