Author: Uri Blass
Date: 09:15:29 10/29/02
Go up one level in this thread
On October 29, 2002 at 11:52:18, Vincent Diepeveen wrote: >On October 29, 2002 at 06:46:18, Uri Blass wrote: > >>On October 29, 2002 at 04:26:38, Dave Gomboc wrote: >> >>>On October 29, 2002 at 04:05:14, Uri Blass wrote: >>> >>>>It is faster to have a special function that generate the moves and calculate >>>>moves that are checks. >>>> >>>>The point is that a lot of moves are from the same from square so I do not need >>>>to check if the from square is in the same direction with the king if I do it in >>>>that way. >>> >>>You may want to work outwards from the king. >>> >>>Dave >> >>Yes >> >>I think that it is a good idea in order to detect fast cases when I do not need >>to check the from square for all moves. >> >>If there is no piece that pseudoattack the king from all directions then it >>means that the only possible checks are based on the to square. >> >>I already do it when I update my pin arrays but I did not think about it when I >>generated my function to detect checks in the first plies of the qsearch. >> >>Note that my pin array can also be optimized. >>Today movei knows only the pinned pieces of the side to move and I believe that >>it is better to know the pinned pieces of both sides and to update them. >> >>Uri > >You could go for something cheap to detect checks in qsearch >and just see whether the 'to' square possibly attacks the king >square, only after that call a function. > >if( quickchecktable[piece][63+kingsq-to] > && slowcheck(piece,to,kingsq) ) > check = true; ... In that case I may miss checks that are not done by the piece that moved. I still have ways to improve the speed without missing checks. Note that I cannot use the difference in the squares to decide if a rook pseudo attack the king because the difference between h2 and a3 is the same as the difference between a3 and b3. I still can use the difference in the squares to decide that there are no case in a lot of cases so maybe it is a good idea to have table like you suggest. Uri
This page took 0.01 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.