Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Debugging a chess program

Author: Federico Corigliano

Date: 16:43:39 12/20/03

Go up one level in this thread


A good idea is to make a CheckPosition() function, that should be used after
Make() or Unmake(). In that function you check:
- that the ep square is in the limits of the board representation: a ap square
with value 150 is wrong if you use a 8x8 board
If you use hashtables:
- that the current position's hash key is correct
If you use bitboards:
- that each piece in the board is included in the respective bitboards in the
current position
- that each piece in a bitboard is in the board in the correct position
If you use piece lists:
- that each piece in the piece list in the correct position in the board
- that each piece in the board is in the piece list
If you use incremental material evaluation:
- that the material in the board is equal to the incremental variable
And the same for each thing that you make in Make() or Unmake()

This will do a big slowdown in you program, but you will sure that you move
generation is correct.

Regards,
Federico



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.