Check out Makruk (Thai Chess), our featured variant for March, 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

Play-test applet for chess variants. Applet you can play your own variant against.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Sat, Oct 29, 2022 02:39 AM EDT in reply to Carlos Cetina from Fri Oct 28 11:43 PM:

 

Ah, I see that I forgot the # that GAME code requires to access variables in a few places. The extra Pre-Game code should really be:

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 does fix the case where the Bishops already start on different shade, by setting them non-virgin so that their Wazir moves are suppressed.

But I was a bit too optimistic about the other case: it does hurt that you did not define a 'pure' Bishop amongst the piece types. Because when the Bishops are on the same shade, and you move the first one as a Wazir, the second one must be forced to move as a Bishop. But it is still virgin, so the move definition of the combi piece cannot be used for it. (It can be used as the definition of a pure Wazir, because it has the W moves after the B moves, so that you can give 124 as start index of the move list instead of 104 to skip the B moves.)

From the point we are now I guess the easiest way is to add the pure Bishop  to the list by hand, making the end of the legdefs array look like

2 99 -1  1     1
  99 -1  0   32771
0
1 99  1  1     3 // pure bishop(598)
1 99  1 -1     3
1 99 -1 -1     3
1 99 -1  1     3
0);

(5 lines inserted). The B and b functions then should refer to this pure Bishop when it needs one:

def B cond #0 (cond flag var ori 598 cond == 1 var wstart 598 cond var wstart 124 104) 0;
def b cond #0 (cond flag var ori 598 cond == 1 var bstart 598 cond var bstart 124 104) 0;

This then seems to do it.