combinatorics example

main
villares 2019-05-18 21:18:30 -03:00
rodzic f4254b9be5
commit 7960387759
2 zmienionych plików z 9 dodań i 7 usunięć

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 117 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 53 KiB

Wyświetl plik

@ -1,6 +1,6 @@
"""
A simple example for class Combination.
fjenett 20090306
Port and tweak of a simple example for class Combination.
by fjenett 20090306
"""
add_library('Combinatorics')
@ -22,11 +22,13 @@ def setup():
i = 0
while (combinations.hasMore()):
combination = combinations.next()
t = ""
for elem in combination:
t += chars[elem] # + " "
fill((i * 64) % 255, 255, 255)
text(t, 20 + x, 20 + y * h)
txt = ""
for n in combination:
elem = chars[n]
txt += elem
m = (int(txt, 16))
fill(m / 16 , 255, 255)
text(txt, 20 + x, 20 + y * h)
x += w
if x > width - 50:
x = 0