fork download
  1. let animationStep = 1;
  2. let cur_speed = 2; // 0.1, 0.5, 1, 8
  3.  
  4. if (cur_speed < 1) {
  5. if (animationStep > (1 / cur_speed)) {
  6. animationStep = 1;
  7. universe.tick();
  8. }
  9. animationStep++;
  10. } else {
  11. for (let index = 0; index < cur_speed; index++) {
  12. universe.tick();
  13. }
  14. }
Runtime error #stdin #stdout #stderr 0.02s 16828KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.js:12:9 ReferenceError: universe is not defined
Stack:
  @prog.js:12:9