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 Fri, Dec 18, 2020 01:42 PM EST in reply to Greg Strong from 12:37 PM:

I don't understand that. The * range is encoded as -1 in the tables, which is then dynamically replaced by the actual range in the move generator:

    switch #rng:
      case -1:
        set rng cond < 0 #dy rank #cursqr - lastrank rank #cursqr;
        set rng - >> lastrank 1 #rng;
        set rng max 1 #rng;

In infix notation this reads

rng = (dy > 0 ? RANK(cursqr) : LASTRANK - RANK(cursqr)); // start rank (flipped for black)
rng = (LASTRANK >> 1) - rng; // distance from board half.
rng = max(1, rng); // minimally 1

On a 10-rank board MAXRANK = 9, so LASTRANK>>1 should be 4. That should give you 4 steps from the back rank (rank 0 for white and 9 for black). From their starting rank it should be 3 steps. I don't see anything wrong here. In particular, I don't see how white and black Pawns could behave differently.

Can the GAME-code variable 'lastrank' actually return the number of board files (minus 1)?