Help for a code

hello I need help on a code, I’m trying to make a line that would move from the top to bottom and
when it reach the bottom it get back to the top. I’ve done this and achieved making it get down but
I can’t manage to make it getting back up.
image
thanks for your help

Retyping out the code you already (so I could run it to see what your sketch does) has used up all the time and effort I had to spare.

Perhaps some other nice person will come along and help you more.

int d = 110;
int b = 25;

void setup() {
  size(600, 600);
}

void draw() {
  background(255);
  if ( 0 <= b && b <= 515 ) {
    b++;
  }
  if ( 85 <= d && d <= 600 ) {
    d++;
  }
  line( 25, b, 25, d);
}

That said, nowhere in your code are you even attempting at making the line go back up. How will your sketch remember which way the line should be moving? When will it know to change direction? Do your variables’ values need to change by a different amount depending on which way the line should be going?

Please at least try to make it work, and post the code of your attempt (AS TEXT!).