Check out Smess, our featured variant for February, 2025.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Interactive diagrams. (Updated!) Diagrams that interactively show piece moves.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote at 09:51 AM UTC in reply to H. G. Muller from 07:58 AM:

I suppose I could reorganize the diagram scripts such that they go entirely inside a function, making the (now local) event handlers available globally by assigning those to global variables. And then set an initially undefined global variable to make sure it is not done a second time. Like:

function Script() {
  function H1() { ... }
  function H2() { ... }
  ... // all function definitions in betza.js or betzaNew.js go here

  if(done !== undefined) return;
  done = 1;
  Handler1 = H1;
  Handler2 = H2;
  ...
}

Script();