reproduce java logic control in if()
<p>what is the most efficient way to translate this Java code into Netlogo:</p>

<pre><code>boolean cont = true;
for (int i = 0; cont &amp;&amp; i &lt; 10; i++) {
  if (condition) {
    // do stuff
      cont = false;
  }
}
</code></pre>

<p>I have tried something along this line:</p>

<pre><code>let cont true
while [cont][
  foreach a-list [
    if (condition)[
      ;; do stuff
      set cont false
    ]
  ]
]
</code></pre>

<p>but it's not as efficient because the foreach might end and the while condition won't</p>