Sure, I understood that these were lines not generated by the applet in an attempt to implement Bishop Conversion. But when BBB, WWW and BWBWBW are not defined, it will return an undefined value. Which is going to give trouble if it is used as an index in the legdefs array.
I see no 'set WWW ...' in the PreGame code anywhere. And I also don't see what it would have to be set too, because there isn't any pure Bishop definition in the legdefs array at all.
[Edit] Well, they would not have to be set to anything; that would only have effect when they were used in the function as #WWW etc. They should just be replaced by the appropriate number. Perhaps you could use use the current legdef table, because it does contain the moves of the BW compound with the W moves only as initial moves. So it could also be used for a non-virgin Bishop. So BBB and BWBWBW should both be 104. And the Wazir moves come at the end of that, so a pure Wazir can be obtained by just using the 4 last moves of the compound, which start 20 places later. So WWW should be replaced by 124.
In the context of Cetina Random Chess there still is a problem, though (from which the Diagram I made also suffers): it always applies the conversion rule, also when the shuffling puts the Bishops on different shades to begin with. It would then still insist one of those started as a Wazir. So it would be necessary to detect whether the Bishops ended on equal or different shade by the shuffling.
[Edit2] OK, I found a solution to the shuffle problem. At the end of the PreGame section, add the code
set b1 findpiece B first spaces;
set b2 findpiece B last spaces;
if & 1 - file b1 file b2:
setflag #b1;
setflag #b2;
endif;
set b1 findpiece b first spaces;
set b2 findpiece b last spaces;
if & 1 - file b1 file b2:
setflag #b1;
setflag #b2;
endif;
This will mark both Bishops as non-virgin in the starting position when their distance is an odd number of squares (i.e. when they are already on different shades). And non-virgin Bishops can never use the Wazir move.
Sure, I understood that these were lines not generated by the applet in an attempt to implement Bishop Conversion. But when BBB, WWW and BWBWBW are not defined, it will return an undefined value. Which is going to give trouble if it is used as an index in the legdefs array.
I see no 'set WWW ...' in the PreGame code anywhere. And I also don't see what it would have to be set too, because there isn't any pure Bishop definition in the legdefs array at all.
[Edit] Well, they would not have to be set to anything; that would only have effect when they were used in the function as #WWW etc. They should just be replaced by the appropriate number. Perhaps you could use use the current legdef table, because it does contain the moves of the BW compound with the W moves only as initial moves. So it could also be used for a non-virgin Bishop. So BBB and BWBWBW should both be 104. And the Wazir moves come at the end of that, so a pure Wazir can be obtained by just using the 4 last moves of the compound, which start 20 places later. So WWW should be replaced by 124.
In the context of Cetina Random Chess there still is a problem, though (from which the Diagram I made also suffers): it always applies the conversion rule, also when the shuffling puts the Bishops on different shades to begin with. It would then still insist one of those started as a Wazir. So it would be necessary to detect whether the Bishops ended on equal or different shade by the shuffling.
[Edit2] OK, I found a solution to the shuffle problem. At the end of the PreGame section, add the code
This will mark both Bishops as non-virgin in the starting position when their distance is an odd number of squares (i.e. when they are already on different shades). And non-virgin Bishops can never use the Wazir move.