当前位置:  开发笔记 > 编程语言 > 正文

可能的谷歌之谜?

如何解决《可能的谷歌之谜?》经验,为你挑选了3个好方法。

我的朋友获得了这个免费的谷歌网站优化器T恤,并来找我尝试找出前面的徽标意味着什么.

T恤衫

所以,我有几个关于它意味着什么的猜测,但我只是想知道是否还有更多东西.

我的第一个猜测是每个块代表一个页面布局,标志"你应该测试"只是意味着你应该使用谷歌网站优化器来测试哪个是最好的布局.我希望这不是答案,它似乎简单而不满意.

好吧,我花了过去一小时试图弄清楚是否有更深层的含义,但无济于事.所以,我在这里希望有人可以提供帮助.

我写了一个程序,看看这些块是否代表二进制文件.我将在下面发布代码.我的代码测试读取块的每个排列为4位,然后尝试将这些位解释为字母,十六进制和IP地址.

我希望有人知道的更好.

#This code interprets the google t-shirt as a binary code, each box 4 bits.
# I try every permutation of counting the bits and then try to interpret these
# interpretations as letters, or hex numbers, or ip addresses.

# I need more interpretations, maybe one will find a pattern

import string

#these represent the boxes binary codes from left to right top to bottom
boxes = ['1110', '1000', '1111', '0110', '0011', '1011', '0001', '1001']

#changing the ordering
permutations = ["1234", "1243", "1324", "1342", "1423", "1432", 
                "2134", "2143", "2314", "2341", "2413", "2431",
                "3124", "3142", "3214", "3241", "3412", "3421", 
                "4123", "4132", "4213", "4231","4312", "4321"]

#alphabet hashing where 0 = a
alphabet1 = {'0000':'a', '0001':'b', '0010':'c', '0011':'d',
             '0100':'e', '0101':'f', '0110':'g', '0111':'h',
             '1000':'i', '1001':'j', '1010':'k', '1011':'l',
             '1100':'m', '1101':'n', '1110':'o', '1111':'p'}

#alphabet hasing where 1 = a
alphabet2 = {'0000':'?', '0001':'a', '0010':'b', '0011':'c',
             '0100':'d', '0101':'e', '0110':'f', '0111':'g',
             '1000':'h', '1001':'i', '1010':'j', '1011':'k',
             '1100':'l', '1101':'m', '1110':'n', '1111':'o'}

hex       = {'0000':'0', '0001':'1', '0010':'2', '0011':'3',
             '0100':'4', '0101':'5', '0110':'6', '0111':'7',
             '1000':'8', '1001':'9', '1010':'a', '1011':'b',
             '1100':'c', '1101':'d', '1110':'e', '1111':'f'} 

#code to convert from a string of ones and zeros(binary) to decimal number
def bin_to_dec(bin_string):
    l = len(bin_string)
    answer = 0
    for index in range(l):
        answer += int(bin_string[l - index - 1]) * (2**index)
    return answer        

#code to try and ping ip addresses
def ping(ipaddress):
    #ping the network addresses 
    import subprocess

    # execute the code and pipe the result to a string, wait 5 seconds
    test = "ping -t 5 " + ipaddress
    process = subprocess.Popen(test, shell=True, stdout=subprocess.PIPE)

    # give it time to respond
    process.wait()

    # read the result to a string
    result_str = process.stdout.read()

    #For now, need to manually check if the ping worked, fix later
    print result_str   

#now iterate over the permuation and then the boxes to produce the codes
for permute in permutations:
    box_codes = []
    for box in boxes:
        temp_code = ""
        for index in permute:
            temp_code += box[int(index) - 1]
        box_codes.append(temp_code)

    #now manipulate the codes using leter translation, network, whatever

    #binary
    print string.join(box_codes, "")

    #alphabet1
    print string.join( map(lambda x: alphabet1[x], box_codes), "")

    #alphabet2
    print string.join( map(lambda x: alphabet2[x], box_codes), "")

    #hex
    print string.join( map(lambda x: hex[x], box_codes), "")

    #ipaddress, call ping and see who is reachable
    ipcodes = zip(box_codes[0:8:2], box_codes[1:8:2])
    ip = ""
    for code in ipcodes:
        bin = bin_to_dec(code[0] + code[1])
        ip += repr(bin) + "."
    print ip[:-1]
    #ping(ip[:-1])
    print
    print

T恤.



1> Joseph..:

我通过电子邮件向网站优化工具团队发送电子邮件,他们说"除非你找到一个,否则没有密码.:)"



2> Max Stewart..:

我认为谷歌只是试图把他们的观点推向家 - 这里有一堆不同的同一页面的表示,测试它们,看看哪个是最好的.

你最喜欢哪个街区?



3> 小智..:

我认为这只是一种设计,没什么秘密或神秘的.

推荐阅读
mylvfamily
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有