mazha's profileA New AgePhotosBlogListsMore Tools Help

Blog


    2/12/2006

    [PC_09] connect the dots

    页面上一棵树的图片,书的轮廓上分布着一些黑点,源文件中提示:
    first+second=?
     
    first:
    146,399,163,403,170,393,169,391,166,386,170,381,170,371,170,355,169,346,167,335,170,329,170,320,170,
    310,171,301,173,290,178,289,182,287,188,286,190,286,192,291,194,296,195,305,194,307,191,312,190,316,
    ……
    second:
    156,141,165,135,169,131,176,130,187,134,191,140,191,146,186,150,179,155,175,157,168,157,163,157,159,
    157,158,164,159,175,159,181,157,191,154,197,153,205,153,210,152,212,147,215,146,218,143,220,132,220,
    ……
     
    于是每两个连续的数为一组,作为一个点的横纵坐标,连起来之后就是两幅图像
    两幅图像叠起来就知道是什么了~~
    没有 PIL 还真做不了呢,当然你也可以字符打点打出来~~
    看着像不像就不知道了~~~
     

    [code]

     
     import Image
     import ImageDraw
     
     im = Image.new("RGBA", (600, 600), (0,0,0,255))
     draw = ImageDraw.Draw(im)
     
     twolist = [first, second]
     for c in twolist:
         for i in range( 0, len(c) - 2, 2 ):
             draw.line((c[i], c[i+1], c[i+2], c[i+3]), 255)
     del draw
     im.save('PIC_09.jpg')
     

     
    文档上说 save 时可以识别文件名,并保存成相应的文件格式的,真牛b~~
    打开 pic_09.jpg 看到一头红牛(如果保存为.png的话是头白牛,hoho)~~
    试试 cow 敲进去,看到一行:hmm. it's a male.
    哈,是呢,人家是长角的~~~
     
    答案就是: BULL !~
     

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://bg5hfc.spaces.live.com/blog/cns!E67CCF4FFB0BE86!1145.trak
    Weblogs that reference this entry
    • None