美文网首页
Python Challenge[33]

Python Challenge[33]

作者: Recgat | 来源:发表于2017-03-24 14:36 被阅读0次

[Level 33]


Title: 33 bottles of beer on the wall

最终从源码中得到 beer2.png。结合之前的提示

If you are blinded by the light,
remove its power, with its might.
Then from the ashes, fair and square,
another truth at you will glare.

嗯,没懂。去除亮点,剩余的数是平方数,重新组成图。

from PIL import Image
import math

with Image.open('beer2.png') as img:
  data = list(img.getdata())
for i in range(254, -1, -1):
  imgData = [d for d in data if d < i]
  x = math.sqrt(len(imgData))
  if x == int(x) and x > 0:
    newImg = Image.new('L', (int(x), int(x)))
    newImg.putdata(imgData)
    newImg.save('img/'+str(x)+'.png')

得到好多个字母,外边有方框的字母组成 gremlinsTemporary End

Python Challenge Wiki

相关文章

  • Python Challenge[33]

    [Level 33] Title: 33 bottles of beer on the wall 最终从源码中得到...

  • Python挑战:00~03关

    Python Challenge Python Challenge 00 网址: http://www.pytho...

  • Python挑战:04-05关

    Python Challenge Python Challenge 04 现在,我们来挑战第四关,从第三关的结果,...

  • The Python Challenge(5)

    问题链接 问题链接如下: 答案链接 答案链接如下: 解题思路 根据页面源码提示: 再点击页面图片显示: 可知是需要...

  • The Python Challenge(8)

    问题链接 问题链接如下: 答案链接 答案链接如下: 解题思路 页面和源码中无任何提示,但图片中有一条很明显的灰度线...

  • The Python Challenge(9)

    问题链接 问题链接如下: 答案链接 答案链接如下: 登陆用户名密码为huge和file。 解题思路 阅读源码有如下...

  • The Python Challenge(2)

    问题链接 问题链接如下: 答案链接 答案链接如下: 解题思路 将页面给定的字符串根据给定规则进行替换即可,规则如下...

  • The Python Challenge(3)

    问题链接 问题链接如下: 答案链接 答案链接如下: 解题思路 根据页面提示: 阅读源码,有如下内容: 编写代码从中...

  • The Python Challenge(4)

    问题链接 问题链接如下: 答案链接 答案链接如下: 解题思路 根据页面提示: 并结合页面源码中的内容,有如下代码:...

  • The Python Challenge(6)

    问题链接 问题链接如下: 答案链接 答案链接如下: 解题思路 根据页面源码提示: python中发音类似的术语有p...

网友评论

      本文标题:Python Challenge[33]

      本文链接:https://www.haomeiwen.com/subject/oszrgttx.html