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