给出的附件是一串01代码,内容如下
0000000001110010000000000
0000000000011110100000000
0000000001110001000000000
0000000010111100000000000
0000000010101010000000000
0000000001100010100000000
0000000010101010100000000
0000000001000001100000000
1100011101110110100011000
0001000010110010010010100
0100111101000011101110011
0011110100101011001001001
1000001001100001001101000
1111000111111011100101000
1011011111001101111110111
1000110110010010101101100
1000111100111111111110111
0000000010110001100010100
0000000010010100101010001
0000000010101010100011001
0000000000100111111110010
0000000000011001011110111
0000000001001100100100001
0000000011000011011011001
0000000011010000101110101
通过观察发现,每一行一共有25个01字符,一共有25行,我们知道,ASCII编码的二进制是8位,Base64编码的二进制是6位,25都无法整除,可以排除。而培根密码则正好是由AB组成的编码,每五位对应一个字符,尝试过后排除。
我们知道矩阵式二维码是由许多小方格组成,每一个方格为有颜色或者无颜色,在代码编制上巧妙地利用构成计算机内部逻辑基础的“0”、“1”比特流的概念。所以我们可以把这些01代码看作一个二维码,我们只需要将这个二维码给还原出来即可。
可以用excel将二维码画出来,因为excel正是一个个的小方格,可以自寻操作,在这里主要记录用Python来编写脚本。
import turtle
def fill(start_x, start_y):
'''
This function will draw a square whose four points are (x, y), (x + 40, y), (x + 40, y + 40), (x, y + 40).
Then the pen go back to the starting coordinates. After that, fill the square up in black.
:param start_x: The x coordinate of the starting point of the pen
:param start_y: The y coordinate of the starting point of the pen
:return: None
'''
turtle.penup() # 将笔抬起,防止移动过程产生轨迹
turtle.goto(start_x, start_y) # 移动到指定点
turtle.pendown(