
Like other demos, you can change the code, and also toggle breakpoints by clicking on the gutter.
// 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();
}
setInterval( addAlpha, 10 );
let inc = 1;
function addBeta() {
beta+=inc;
updateOutput();
if(beta>=160) {
inc=-1;
}
else if(beta<=0) {
inc=1;
}
}
setInterval( addBeta, 10 );