@Xc-liu
2016-04-03T11:46:45.000000Z
字数 1534
阅读 868
line0=['#','#','#','#','#','#','#','#','#','#','#','#','#','#','#']
line1=['#','#','#','#','#','#','#','#','#','#','#','#','#','#','#']
line2=['#','#','#','#','#','#','#','#','#','#','#','#','#','#','#']
line3=['#','#','#','#','#','#','#','#','#','#','#','#','#','#','#']
line4=['#','#','#','#','#','#','#','#','#','#','#','#','#','#','#']
def display_a1():
line0[0:1]=[' ']
line0[1:2]=[' ']
line0[3:4]=[' ']
line0[4:5]=[' ']
line1[0:1]=[' ']
line1[1:2]=[' ']
line1[2:3]=[' ']
line1[3:4]=[' ']
line1[4:5]=[' ']
line2[0:1]=[' ']
line2[4:5]=[' ']
line3[1:2]=[' ']
line3[2:3]=[' ']
line3[3:4]=[' ']
line4[1:2]=[' ']
line4[2:3]=[' ']
line4[3:4]=[' ']
def display_a2():
line0[5:6]=[' ']
line0[6:8]=[' ']
line0[8:9]=[' ']
line0[9:10]=[' ']
line1[5:6]=[' ']
line1[6:7]=[' ']
line1[7:8]=[' ']
line1[8:9]=[' ']
line1[9:10]=[' ']
line2[5:6]=[' ']
line2[9:10]=[' ']
line3[6:7]=[' ']
line3[7:8]=[' ']
line3[8:9]=[' ']
line4[6:7]=[' ']
line4[7:8]=[' ']
line4[8:9]=[' ']
def display_a3():
line0[10:11]=[' ']
line0[11:12]=[' ']
line0[13:14]=[' ']
line0[14:15]=[' ']
line1[10:11]=[' ']
line1[11:12]=[' ']
line1[12:13]=[' ']
line1[13:14]=[' ']
line1[14:15]=[' ']
line2[10:11]=[' ']
line2[14:15]=[' ']
line3[11:12]=[' ']
line3[12:13]=[' ']
line3[13:14]=[' ']
line4[11:12]=[' ']
line4[12:13]=[' ']
line4[13:14]=[' ']
display_a1()
display_a2()
display_a3()
print line0
print line1
print line2
print line3
print line4
通过几个列表形成一个井号的点阵,再根据不同字母的形状和其需要显示的目标区域,去掉点阵中的一些井号。这样就会在目标区域显示相应字母的形状。(本程序中井号点阵分成三个5*5的小区域,故最多只能并列显示三个字母)