Começando a Desenhar Doideras com Python

Bernardo Fontes
Jul 5 · 7 min read
Imagem criada por mim com código Python.

Passo 1 — Instalando o Processing

Algoritmo de Agregação por Difusão Limitada — código fonte

Passo 2 — Conhecendo a IDE do Processing

Muito prazer! Eu sou a IDE do Processing
void setup(){
size(100, 100);
}
void draw(){
fill(255, 0, 0);
ellipse(width / 2, height / 2, 30, 30);
}
wow so creative!
Gif criado por mim com código Python

Passo 3 — Instalando o Modo Python

Tela com o resultado da busca por “python”
def setup():
size(700, 280)
colorMode(HSB, 255)
def draw():
rect_height = height / 7
y_positions = range(0, height, rect_height)
for y in y_positions:
color_pos = map(y, 0, height, 0, 255) # not Python's map
fill(color_pos, 210, 210)
stroke(27)
strokeWeight(2)
rect(0, y, width, y + rect_height)

Bernardo Fontes

Written by

Eles querem sacudir a rede. Eu vim para arrancar a trave. https://berinfontes.com/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade