Author: David Hanley
Date: 11:42:44 09/20/02
Go up one level in this thread
Thanks ian. I do have nullmove in place. It makes a big big difference, though i have seen my program choose different moves with nullmove in place. Not really worse moves, just different ones. I don't do nullmove if the side to move has only 1 rook, knight, or bishop left, so i haven't seen nullmove screw up anything yet. The code for it is pretty straightforward: (null-Cutoff? ()(when (and (not last-move-was-null?) (>= (- search-depth at-ply) 3) (not (am-i-in-check?)) (> (to-move-non-pawn-material) (piece-value wrook))) (let ((eps en-pesant-target)) (setf en-pesant-target -1) (switch-to-move) (setf last-move-was-null? T) (setf (svref search-move-stack at-ply) nil) (let ((score (- (negamax (+ at-ply 1) (- search-depth 2) (- beta) (1+ (- beta)))))) (setf en-Pesant-Target eps) (switch-to-move) (>= score beta))))) I don't have checking move extension, i just tried doing s simple one-line version: (when (am-i-in-check?) (incf search-depth)) But that seems to make the search grow pretty quickly. >Also, writing in Lisp has similar problems to writing in a threaded code Forth, >with similar solutions. > >1. Eliminate dynamic allocation. All structures in TSCP are preallocated. Not >very Lisp-like, though. I do preallocate quite a bit now--i no longer build move linked lists in my move generator.. :) There's a few things i still won't preallocate, but i don't think those cases are very critical, and i'm willing to accept a slight slowdown for code 'beauty.' >2. Use macros for small functions. I got a 12% speedup simply by inlining the >one most often called function! Nice. ;) I have some "inline" declarations that seem to help quite a bit. >3. Use piece lists. This is a natural fit for Lisp. Yeah--that seems like a good idea. Especially for the endgame. >4. Use function tables in preference to conditionals. I imagine functional >solutions to problems are more natural in Lisp anyway. Yes--i have pieces as structures, and each structure has a slot with an array of 64 function pointers which are move generators for that piece for that square. So only the white king move generator for e1 needs to check for castling contions, etc. dave
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.