Like other demos, you can change the code, and also toggle breakpoints by clicking on the gutter.
Like other demos, you can change the code, but toggling breakpoints and also highlighting
the next line is deactivated because ace editor is not loaded.
(Check your internet connection as ace could be really helpful in this demo!)
// Note that running will continue after script end, // because of the timeout. It can be stopped by clearing // the timeout. // You can pause the execution to prevent setting a new // timeout. You may also set a breakpoint in the timer // callback function, it will be stopped upon reaching it, // even after the script is ended. That is why the puase // button is still enabled after the end. function addAlpha() { alpha+=1; updateOutput(); alpha_timeout = setTimeout( addAlpha, 10 ); } clearTimeout(alpha_timeout); setTimeout( addAlpha, 10 );
let inc = 1; function addBeta() { beta+=inc; updateOutput(); if(beta>=160) { inc=-1; } else if(beta<=0) { inc=1; } beta_timeout = setTimeout( addBeta, 10 ); } clearTimeout(beta_timeout); setTimeout( addBeta, 10 );