# Making a loop infinite

**URL:** <https://discourse.processing.org/t/making-a-loop-infinite/14373>\
**Category:** Coding Questions\
**Created:** [October 2, 2019, 4:20pm UTC](https://discourse.processing.org/t/making-a-loop-infinite/14373 "2019-10-02T16:20:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian1998](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@Adrian1998](https://discourse.processing.org/u/Adrian1998)\
**Post date:** [October 2, 2019, 4:20pm UTC](https://discourse.processing.org/t/making-a-loop-infinite/14373/1 "2019-10-02T16:20:02Z")

</div>

Hello, so I need help with finding a way to make the black striped lines infinte, currently it starts at -100, but the lines stops printing after a little. Also im having trouble with the yellow solid line, currently the lines print on top of the yellow line i want the yellow line to be on top of the black lines I currently do not know what I am doing wrong.

```auto
void setup() {
  size(600,400);
}
int offset = -100;
int offset2 = 900;
int offset3 = -100;
int offset4 = -100;
int offset5 = -200;
void draw() {
  stroke(1);
  strokeWeight(3);
  background(98,96,96);
  stroke(2);
  strokeWeight(1);
  for (int i = 0; i <= 1000; i = i+5 ) {//I need help here
 line(offset+i,0,offset+i,400);// I need help here
 fill(255,248,31);
 rect(offset+i*13,200,40,10);//I need help here
 rect(offset2,0,50,500);
 fill(219,22,4);
 rect(offset,mouseY,100,70);
 fill(0,0,0);
 rect(offset+50,mouseY+15,30,40);
 fill(0,255,0);
 rect(offset3,mouseY-200,100,70);
 fill(0,0,0);
 rect(offset3+50,mouseY-185,30,40);
}
offset +=2;
offset2 -=2;
offset3 +=1;
}

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [October 2, 2019, 5:10pm UTC](https://discourse.processing.org/t/making-a-loop-infinite/14373/2 "2019-10-02T17:10:17Z")

</div>

draw() loops in itself

modify the for loop by killing it in bring i++; at the end of draw().
