Well, GAME-code doesn't excell in clarity of error messages. So we have to figure out what the problem is by trial and error. For this purpose we will start with a very simple definition of BadZone, and gradually increase its complexity to see how far we get. Start with:
def BadZone false =O =dest =locust =D =P;
This should allow everything, including 2-, 3- and 4-step castling with both Cannon and Rook. Then try:
def BadZone #locust =O =dest =locust =D =P;
This should not allow any castling or e.p. capture. Then:
def BadZone #locust and match #locust #partners =O =dest =locust =D =P;
This should now also allow e.p. capture, but all castlings would still be forbidden. Then:
def BadZone #locust and match #locust #partners and match #dest #badCannons =O =dest =locust =D =P;
This should allow everything except 2-step castlings.
Well, GAME-code doesn't excell in clarity of error messages. So we have to figure out what the problem is by trial and error. For this purpose we will start with a very simple definition of BadZone, and gradually increase its complexity to see how far we get. Start with:
def BadZone false =O =dest =locust =D =P;
This should allow everything, including 2-, 3- and 4-step castling with both Cannon and Rook. Then try:
def BadZone #locust =O =dest =locust =D =P;
This should not allow any castling or e.p. capture. Then:
def BadZone #locust and match #locust #partners =O =dest =locust =D =P;
This should now also allow e.p. capture, but all castlings would still be forbidden. Then:
def BadZone #locust and match #locust #partners and match #dest #badCannons =O =dest =locust =D =P;
This should allow everything except 2-step castlings.