title: P5.Js - how can I change line() color in a while-loop on specific x-values?
body: <p>I am doing a small assignment that requires the following: </p>
  
  <p>I have to create a while-loop that draws 30 lines on-screen. Line number 7 and line number 23 should be colored red. </p>
  
  <p>Because I am still trying to figure things out, I try to color the 2 nearest lines from stroke(0); to stroke(255);, but no matter what I try, I cannot get the 2 lines to change color</p>
  
  <p>In this example I tried nesting a while loop, which so far doesn't work. I also tried removing the nested while loop and add an "if" statement with the same variables (x == 40 &amp;&amp; x == 60) but still nothings happens. What can I do to fix this? </p>
  
  <pre><code>var x = 20;
  var stap = 20;
  var stop = 600;
  
  function setup () {
    createCanvas(700, 700);
  }
  
  function draw () {
    stroke(0);
  
    while(x &lt; stop) {
      line(x, 60, x, 80);
      x += stap;
  
      while (x == 40 &amp;&amp; x == 60) {
        stroke(255);
      } 
    }
  }
  </code></pre>