Check out Alice Chess, our featured variant for June, 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 Logs. View the logs of games played on Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Sat, Jun 22 01:06 PM UTC in reply to H. G. Muller from 08:00 AM:

In principle legality of each psudo-legal move M can be tested by performing the move, and then trying all pseudo-legal moves of the opponent to see if any of those captures the King.

This is beginning to explain how you organize the evaluation of moves, and there are some differences from what I do. My code does not perform every move before testing it. While it does perform actual moves before testing them, it evaluates potential moves without performing them. When it comes to evaluating whether a move places a King in check, it does not go through a list of pseudo legal moves to see if any capture the King. Instead, it does not bother to build a list of pseudo legal moves for the position, and it simply checks whether any enemy piece has a legal move to the King's position. After all actual moves have been evaluated, my code will then evaluate the potential moves and build a list of legal moves. It evaluates each potential move in stages. First, it builds a list of the spaces the piece might possibly reach with its powers of movement. Then it checks for pseudo-legal moves to these spaces. For each pseudo-legal move it finds, it performs the move to check whether the resulting position places the King in check.

Since this is in the context of the Advancer, which does not capture by displacement, I will mention here that my code assumes displacement capture but can handle non-displacement capture when appropriate functions are written for it. I have done this for Ultima, and I have an earlier comment explaining this in detail.

What I was saying I don't understand, though, was how you handle the evaluation of individual moves. My code evaluates individual moves with individual functions for each piece and sometimes employs subroutines for evaluating actual moves. The functions are all designed to work without the need of performing the move first. Since actual moves get performed before their evaluation, a subroutine may sometimes be used for the actual move of a divergent piece. But if a divergent piece has no side effects, a function might be designed to work for both actual and potential moves, such as this Cannon function is:

def Cannon cond cond empty #0 capture (not empty #1) (checkhop #0 #1 0 1) (checkride #0 #1 0 1) and #1;

This function tests whether the origin space is empty to tell whether the move has already been performed. If it has been performed, it tests whether a capture has been made, and if it hasn't been performed, it tests whether the destination space is occupied.

Anyway, your code employs huge tables that somehow define how a piece moves, and I don't understand how these work.