Check out Janggi (Korean Chess), our featured variant for December, 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 code table-driven move generator[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Tue, Aug 11, 2020 08:45 PM UTC in reply to H. G. Muller from 07:14 AM:

I am just using legalMoves as a vehicle to transfer information from the GAME code to the JavaScript in the move-entry pages, because at this point it seems the only way to transfer information that way.

As I've mentioned to you a couple times already, it is no longer the only way. I have created an $extralegal variable for additional legal moves. Besides using this to help populate the datalist for the moves field, I am using it to populate an array currently called legalList to distinguish it from the legalMoves array. This is an array of legal moves as strings of text. I have begun working on modifying movePiece() to make use of it. I am currently working on the version for square table boards. It can handle standard moves without any problem right now, but I am working on getting it to work with non-standard moves, starting with fission moves in Fusion Chess. These moves involve moving a different piece than the one currently on the space it moves away from.

The way I currently have it testing the legality of a move is to make sure the currently entered move is the only match among the legal moves. When I have this working for fission moves, I'll work on offering multiple choices.