I also leave here the dirty script.
import os
#params
width = 20 #how many each row
q = 128 #how many in total
def gen7seg(segs):
line1 = ""
line2 = ""
line3 = ""
line1 += " "
if( (segs >> 6) & 1): line1 += "_ "
else: line1 += " "
if( (segs >> 1) & 1): line2 += "|"
else: line2 += " "
if( (segs >> 0) & 1): line2 += "_"
else: line2 += " "
if( (segs >> 5) & 1): line2 += "|"
else: line2 += " "
if( (segs >> 2) & 1): line3 += "|"
else: line3 += " "
if( (segs >> 3) & 1): line3 += "_"
else: line3 += " "
if( (segs >> 4) & 1): line3 += "|"
else: line3 += " "
return [line1, line2, line3]
printed = 0
finished = False
while(not finished):
out_line1 = ""
out_line2 = ""
out_line3 = ""
for _ in range(width):
[a, b, c] = gen7seg(printed)
out_line1 += (" " + a)
out_line2 += (" " + b)
out_line3 += (" " + c)
if(printed < q-1): printed += 1
else:
finished = True
break
print(out_line1)
print(out_line2)
print(out_line3)
input()
Speak if it was useful for something.
No comments:
Post a Comment