Alexandre B A Villares 2018-09-19 16:10:35 -03:00
rodzic 05027d24f9
commit 4380349a73
3 zmienionych plików z 40 dodań i 12 usunięć

Wyświetl plik

@ -6,6 +6,17 @@ Hi! I'm [Alexandre Villares](https://abav.lugaralgum.com), let's see if I can ma
If you enjoy this, be a [patreon](https://patreon.com/arteprog) or make a donation [here](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HCGAKACDMVNV2)
---
![s264](s264/s264.png)
264: [code](https://github.com/villares/sketch-a-day/tree/master/s264) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
---
![s263](s263/s263.png)
263: [code](https://github.com/villares/sketch-a-day/tree/master/s263) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
---
![s262](s262/s262.png)

BIN
s264/s264.png 100644

Plik binarny nie jest wyświetlany.

Po

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

Wyświetl plik

@ -6,23 +6,40 @@ def setup():
size(600, 600)
noFill()
rectMode(CENTER)
strokeWeight(3)
def draw():
noLoop()
background(255)
translate(width/2, height/2)
grid(20, squares, 20, 10)
def squares(i, j, spacing, w):
with pushMatrix():
translate(-order * spacing / 2, -order * spacing / 2)
rect(spacing/2 + i * spacing, spacing/2 + j * spacing, w, w)
for _ in range(100):
order = int(random(5, 10))
spacing = 20
radius = random(0, 5)
x = random(order * spacing/2, width - order * spacing/2)
y = random(order * spacing/2, height - order * spacing/2)
grid(x, y, order, spacing,
rect, 10, 10, *[radius]*4)
def grid(order, function, *args):
for i in range(order):
def grid(x, y, order, spacing, function, *args):
with pushMatrix():
translate(x - order * spacing / 2, y- order * spacing / 2)
for i in range(order):
for j in range(order):
function(i, j, , order, *args)
function(spacing/2 + i * spacing, spacing/2 + j * spacing,
*args)
def keyPressed():
if key == " ": loop()
# def squares(order, i, j, x, y, spacing, w):
# with pushMatrix():
# translate(x - order * spacing / 2, y- order * spacing / 2)
# rect(spacing/2 + i * spacing, spacing/2 + j * spacing, w, w)
# def grid(x, y, order, spacing, function, *args):
# for i in range(order):
# for j in range(order):
# function(order, i, j, *args)
# print text to add to the project's README.md
def settings():