Trying to enforce the rules to the Cetina Random Chess preset through the Play-Test Applet I get this warning:
Syntax Error on line 279
Missing both default and case "#rng" in switch
I don't know what that means nor how to fix it. Could you please take a look at it?
Well, the switch statement against which it complains should only be executed when #rng (the range of a move) is negative. The if statement around that should guarantee that. The legdefs array from which this range is taken does not contain any negative range.
So I suspect this is a case of misalignment, where the start value used in the array for the moves of a piece is 'out of register', so that numbers that represent board-step coordinates are interpreted as a range. I suspect it has to do with these lines for the Bishop Conversion:
def B cond #0 (cond flag var ori BBB cond == 1 var wstart BBB cond var wstart WWW BWBWBW) 0;
def b cond #0 (cond flag var ori BBB cond == 1 var bstart BBB cond var bstart WWW BWBWBW) 0;
These functions B and b are supposed to return the number of the starting element of the list of moves for the B and b piece in the legdefs array. I suppose they somehow return an incorrect number. Does the error disappear when you remove those lines, or just let the functions B and b return 0 always?
[Edit] It seems you have removed the lines, and the error has now disappeared. What are BBB, WWW and BWBWBW supposed to be anyway? They did not seem to be defined anywhere; their only occurrence was in those two functions.
Well, the switch statement against which it complains should only be executed when #rng (the range of a move) is negative. The if statement around that should guarantee that. The legdefs array from which this range is taken does not contain any negative range.
So I suspect this is a case of misalignment, where the start value used in the array for the moves of a piece is 'out of register', so that numbers that represent board-step coordinates are interpreted as a range. I suspect it has to do with these lines for the Bishop Conversion:
def B cond #0 (cond flag var ori BBB cond == 1 var wstart BBB cond var wstart WWW BWBWBW) 0;
def b cond #0 (cond flag var ori BBB cond == 1 var bstart BBB cond var bstart WWW BWBWBW) 0;
These functions B and b are supposed to return the number of the starting element of the list of moves for the B and b piece in the legdefs array. I suppose they somehow return an incorrect number. Does the error disappear when you remove those lines, or just let the functions B and b return 0 always?
[Edit] It seems you have removed the lines, and the error has now disappeared. What are BBB, WWW and BWBWBW supposed to be anyway? They did not seem to be defined anywhere; their only occurrence was in those two functions.