Author: Robert Hyatt
Date: 07:18:22 09/20/98
Go up one level in this thread
On September 20, 1998 at 02:06:21, Serge Desmarais wrote: >On September 19, 1998 at 13:19:07, Robert Hyatt wrote: > >>On September 19, 1998 at 11:14:40, Guillem Barnolas wrote: >> >>> >>> I am currently developing a pascal chess program which I think will be >>>quite weak, because to generate legal moves I'm generating all the moves and >>>then discarding the ones that leave the king in check... Generating only legal >>>ones seems quite tough.. I now crafty does, but considering it's in C and uses >>>bitboards, it's quite difficult for me to understand it.. I tried tscp, but it >>>uses the same technique that me (I should say i use the same that it uses..;) I >>>have thought of some way of doing this, but seem a little weird... I'll try to >>>explain in few words... I thought I could go from the king_position looking if >>>there are friendly pieces blocking possible attacks...(I think I might have seen >>>this in Crafty or some other program, as X_ray attacks...) and mark those >>>friendly pieces...afterwards i go through all the board and for non-marked >>>pieces I generate all the movements.. for pieces marked once I generate captures >>>to the attacking piece and movements on that direction.. for the pieces marked >>>more than once I generate no movements... I don't know If this would miss >>>anything... I haven't implemented it because I'm still fighting with the program >>>;-D... >>> >> >>this is not really necessary. I generate legal moves only if I start off in >>check, because it is more efficient (in my code) to generate only legal moves >>than it is to generate a bunch of moves and cull them one at a time by noting >>that the king is in check after making them... >> >>But for the normal case, I generate all moves, and let the search at the next >>ply reject a move from this ply if it can capture the king, which means that >>move was illegal. It doesn't happen often, *except* when you are in check. Then >>almost all moves are illegal... > >[Snip] > >Ah! So that is the reason why sometimes I see illegal moves in the end of the PV >of certain programs? I thought it was caused by the selective extensions! > > >Serge Desmarais I don't think so, but I'm not certain. I don't see how an "illegal" move could end up on a PV, because it has to be confirmed by the search before it can ever get backed up as a PV move. It might be possible for the last move in the PV to be illegal in some programs (never in crafty, however, because after the last move, I flip sides, and call quiesce() again which produces the PV for this line, but also generates moves to see if there is another capture, and this will capture the king and reject the previous move instantly. I think "illegal moves" in the PV come from programs that don't back up a PV, but use the hash table to reconstruct the PV after the fact. This can certainly produce illegal moves. In crafty, when I have a one-move PV (after a fail high, for example) the first way I try to get a ponder move is to do a hash probe to see if I get a hit. I then check this move for legality if I get a hit, and I do, on occasion, get a hit but the move doesn't pass the legality check... I output a note in the log files and do see this occasionally... so that doing this to reconstruct the PV would also produce fishy moves at times.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.