[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]
Check out Janggi (Korean Chess), our featured variant for December, 2024.
Check out Janggi (Korean Chess), our featured variant for December, 2024.
That is only simple because you assume you only have to switch on the complex implementation that was already done by someone else. The number of lines needed to implement this in general (i.e. give every piece type a configurable size, 1x1 by default) is not very large. But they would then be executed very often, as they would appear in the innermost of all loops, doing a 2d scan of the specified area for every step in a move, where it now simply tests the occupant of a square. So it would cause an enormous slowdown in all variants, also those having only 1x1 pieces.
A better solution would be to allow custom generation for some given piece types (using X as their Betza descriptor). That would only require one simple test per piece for pieces that do not have it, which can even be combined with the test for already existing special Betza atoms such as the Imitator. So it would cause zero slowdown in normal variants, and a very tiny slowdown in variants that feature an Imitator. The custom script that would then be invoked would only have to deal with the move the multi-square piece actually has, and can ignore complexities like multi-leg, move induction, and in the case of the Dev, even sliding.
'Include files' are an intrinsic HTML feature; the betza.js script is in fact an include file. You could include as many .js files as you like in a page, or write script in the page itself. JavaScript also has the property that you can redefine routines; the last one of the same name it encounters is the one that will apply.
Since the betzaNew.js file is still considered experimental, the xxxTinker routine is not officially documented yet. (Except perhaps burried in the Comments).