Check out Glinski's Hexagonal Chess, our featured variant for May, 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

Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Mon, Feb 19 09:58 PM UTC in reply to Daniel Zacharias from 09:46 PM:

Why doesn't chess need to do that to handle promotions?

Promotions are a different type of move than regular moves. Instead of moving a piece from one location to another, a promotion changes the last piece to move to another piece. So, it does not change the values of $origin and $dest. To check whether a promotion has happened, you can compare the value of $moved, which was set when the piece moved from one location to another, with what currently occupies the space moved to (space $dest). When they are different, a promotion has happened, and you can deploy code for testing whether it was a legal promotion.