diff --git a/README.md b/README.md index ec998693..fcf2d892 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/s264/s264.png b/s264/s264.png new file mode 100644 index 00000000..b60a249f Binary files /dev/null and b/s264/s264.png differ diff --git a/s264/s264.pyde b/s264/s264.pyde index fdc82ac8..46b5ff7d 100644 --- a/s264/s264.pyde +++ b/s264/s264.pyde @@ -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():