Author: Sune Fischer
Date: 03:58:41 12/01/03
Go up one level in this thread
On December 01, 2003 at 02:56:17, Uri Blass wrote: >On November 30, 2003 at 19:43:00, Sune Fischer wrote: > >>On November 30, 2003 at 18:50:07, Gerd Isenberg wrote: >> >>><snip> >>>>>The rule I would follow is: "You cannot play a move which puts your own king >>>>>into check." I hope that was built into all chess engines. >>>>> >>>>>Bob D. >>>> >>>>Sure, but if you want to implement legal move generation, >>>>to avoid making/unmaking invalid moves, you need some other conditions. >>>>Ep is a bit annoying, all others are easier to implement. >>>>Pinned piece determination is required, but also fine for other purposes. >>>> >>>>Gerd >>> >>>There are always these pathological positions. >>>This one to get the idea of legal move generation ;-) >>> >>>[D] 8/5p2/pP2k2p/P3q3/1p2Q3/rR2K1Rr/3B3P/2b3n1 w - - >> >>No pun intended, but what is it that is so clever about legal move generation? >> >>It seems faster to put off the expensive legality check until the last moment >>just before you make the move. >>That way you save a lot of legality checking if/when you fail high. > >I do not have legality checks in many cases. > >If the knight is pinned then I do not generate moves of it and I never need to >check for every move if it is legal. > >if the rook is pinned then I can generate only moves of the rook to the pin >direction. Yes I can see how you get some discount if you need all the moves. Typicly you only have to concern yourself with the 'from' square of each piece, then you can generate a batch of moves with no extra checking. But the slowdown, I think, is in that you have at least one check for each moving piece. Perhaps it is not that slow if done right, maybe I should give it a try sometime :) >The knowledge about pins can also be used for better pruning. > >Even in case of king move there is no expensive legality checks because finding >if the square is under threat is done by one look in the table. > >Of course I waste time for updating the tables but the tables can be productive >for other things. The eternal issue of tables :) Have you tried doing this stuff on the fly? For me it is faster to have an ordinary and 'slow' attack routine because I only need it for a few squares and not the whole board. The main speed up is in the endgame, I don't do king safety there so I don't need attack info around the king (I also think there are other ways to do king safety, btw:). -S.
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.