Created
October 18, 2021 15:29
-
-
Save tiagocordeiro/dd5193fda78bc78fa9b55fc6f2802496 to your computer and use it in GitHub Desktop.
Exemplo com pyp5js: https://berinhard.github.io/pyp5js/pyodide/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
def setup(): | |
createCanvas(500, 500) | |
background(240, 240, 200) | |
rectMode(CENTER) | |
noFill() | |
for k in range(5): | |
for j in range(10): | |
pos_y = j * 50 | |
for i in range(10): | |
x = i * 50 | |
stroke(randint(100, 255), 128, randint(0, 128)) | |
tamanho = randint(20, 45) | |
# translate(j / 2, i / 2) | |
# angulo = randint(1, 2) | |
# rotate(radians(angulo)) | |
ox, oy = randint(23, 27), randint(23, 27) | |
rect(x + ox, pos_y + oy, tamanho, tamanho) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment