Alexandre B A Villares 2022-09-09 18:44:28 -03:00
rodzic 6b14612bf3
commit 1bcbeae476
3 zmienionych plików z 37 dodań i 0 usunięć

Plik binarny nie jest wyświetlany.

Po

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

Wyświetl plik

@ -0,0 +1,29 @@
from itertools import product
w = 6
def setup():
size(243 * 7 + 1, 81 * 7 + 1)
no_smooth()
rect_mode(CENTER)
background(0)
no_stroke()
elements = product((-1, 0, 1), repeat=2) # 4 grid positions
on_offs = (((el, color(200, 0, 0)),
(el, color(0, 200, 0)),
(el, color(0, 0, 200))) for el in elements)
combos = sorted(product(*on_offs))
print(f'Combinations: {len(combos)}')
translate(1, 1)
x = y = w / 2
for combo in combos:
for (xo, yo), state in combo:
fill(state)
square(x + xo * w / 3,
y + yo * w / 3,
w / 3)
x += w + 1
if x > width:
x = w / 2
y += w + 1
save_frame('out.png')

Wyświetl plik

@ -27,6 +27,14 @@ Here are listed some of the tools I have been using:
---
### stketch_2022_09_09
![stketch_2022_09_09](2022/stketch_2022_09_09/stketch_2022_09_09.png)
[stketch_2022_09_09](https://github.com/villares/sketch-a-day/tree/main/2022/stketch_2022_09_09) [tkinter]
---
### stketch_2022_09_07
![stketch_2022_09_07](2022/stketch_2022_09_07/stketch_2022_09_07.png)