Tati

Documentation Home | Class Docs | Github | npm Package ||| Simple Demo | Worker Demo | Dual Debuggers

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!)

Hint: Start and then Continue both scripts to get what is going on, then play around!
// 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 );


|||
					
Copyright (C) 2022-2023 Arash Kazemi <contact.arash.kazemi@gmail.com>
(Tati project is subject to the terms of BSD-2-Clause License, for more information see the LICENSE file in the root directory of the project)