Check out Grant Acedrex, our featured variant for April, 2024.


[ 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

Interactive diagrams. Diagrams that interactively show piece moves.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Tue, Dec 28, 2021 05:55 PM UTC in reply to Aurelian Florea from 03:59 PM:

Promotion is done based on the piece type, so if the Joker is not amongst the promotable pieces, it will not promote. Only moves are immitated.

Because you have two different kinds of Pawns the test for it becomes complicated. In any case the destination square must be empty. But then for normal Pawns diagonal moves must be excluded, and for Berolinas the straight moves. So omething like

if(board[toRank][toFile] & 511) {
  if(pieceType == 1) return (toFile != fromFile);
  if(pieceType == 2) return (toFile == fromFile);
}