mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 11:21:06 +01:00
25 lines
426 B
Plaintext
25 lines
426 B
Plaintext
/**
|
|
* Embedding Iteration.
|
|
*
|
|
* Embedding "for" structures allows repetition in two dimensions.
|
|
*
|
|
*/
|
|
|
|
|
|
size(640, 360);
|
|
background(0);
|
|
noStroke();
|
|
|
|
int gridSize = 40;
|
|
|
|
for (int x = gridSize; x <= width - gridSize; x += gridSize) {
|
|
for (int y = gridSize; y <= height - gridSize; y += gridSize) {
|
|
noStroke();
|
|
fill(255);
|
|
rect(x-1, y-1, 3, 3);
|
|
stroke(255, 50);
|
|
line(x, y, width/2, height/2);
|
|
}
|
|
}
|
|
|