main
Alexandre B A Villares 2018-09-29 00:19:58 -03:00
rodzic df06fbb0ea
commit 9078323180
1 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -1,18 +1,25 @@
table = []
gliphs = ""
def setup():
global gliphs
size(100, 100)
fill(0)
textSize(60)
textAlign(CENTER, CENTER)
for c in range(10, 256):
printable_ascii = list(range(32, 127)) + list(range(161, 256))
for c in printable_ascii:
gliph = chr(c)
if gliph != u"":
if gliph:
background(255)
text(gliph, width/2, height/2)
tally = count_pixels()
print("{}({}) black: {} white: {} other: {}"
.format(c, gliph, *tally))
gliphs += gliph
table.append(tally)
print(gliphs)
def count_pixels():
black, white, other = 0, 0, 0