title: Can i make my p5.js draw() function run only once, and then only on a button click?
body: <p>I have this snippet of p5.js code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let x = 10;
  let y = Math.floor(Math.random()*201);
  let x2 = 190;
  let y2 = 200 - Math.floor(Math.random()*201);
  
  function setup() {
      createCanvas(200, 200);
  }
  
  function draw() {
      clear();
      y = Math.floor(Math.random()*201);
      y2 =  200 - Math.floor(Math.random()*201);
      line(10, y, 190, y2);
  } </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/p5.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and I want to make it so that it runs once automatically, then again every time a button is pressed.</p>
  
  <p>My main concern here is the "run only once" bit, so if anyone can help me out with that, it'd be great.</p>
  
  <p>Thanks in advance! :)</p>