for loop help please!
in
Programming Questions
•
3 years ago
i'm very new to processing and i am trying to make a pattern with the same shape repeating in rows and columns. i used a for loop for() but ive only been able to stretch out the shape instead of repeating it in different positions. here is what i have so far. please please help me!
int y1=0;
int x1=85;
int x2=0;
int y2= 80;
void setup() {
size (600,600);
background(255);
smooth();
}
void draw (){
background(255);
noFill();
strokeWeight(4);
stroke(0, 0, 0);
for (int y1=0; y1<=height; y1=y1+50) {
for (int x1=0; x1<+ width; x1=x1+50) {
for (int x2=0; x2<+ width; x2=x2+50){
for (int y2= 0; y2<=height; y2=y2+50)
bezier(x1, y1, 10, 10, 90, 90, x2, y2);
bezier(x1,y1,0,0,50,50,x2,y2);
}
}
}
}
int y1=0;
int x1=85;
int x2=0;
int y2= 80;
void setup() {
size (600,600);
background(255);
smooth();
}
void draw (){
background(255);
noFill();
strokeWeight(4);
stroke(0, 0, 0);
for (int y1=0; y1<=height; y1=y1+50) {
for (int x1=0; x1<+ width; x1=x1+50) {
for (int x2=0; x2<+ width; x2=x2+50){
for (int y2= 0; y2<=height; y2=y2+50)
bezier(x1, y1, 10, 10, 90, 90, x2, y2);
bezier(x1,y1,0,0,50,50,x2,y2);
}
}
}
}
1