Computer Chess Club Archives


Search

Terms

Messages

Subject: Killer Moves

Author: Rick Bischoff

Date: 15:42:51 07/12/03


Hi all,

First time poster, long time listener(reader) :-)  Anyway, I am busy away
implementing my chess engine and have a question about killer moves-- first some
background:

My move structure has a "score" field that is used to sort the moves in
descending order after generation.  This score is simply 0 for no captures,
PieceValue(Captured) - PieceValue(MyOwnPiece) + PieceValue(QUEEN) +
PieceValue(PROMOTION).

Ok, so now I have an array somewhere called : int killerMoves[MAX_PLY][64*64]

and my idea is this--
  A) After a "real" move is made, zero out the entire array
  B) During move generation, for each move M, if
killerMoves[ply][M.from*64+M.to]>0, M.score = that value
  C) During the search...

... if (val >= beta) { killerMoves[ply][currentMove.from * 64 + currentMove.to]
= M.score + 1;  return beta; }

.... }
.... killerMoves[ply][bestMove.from*64 + bestMove.to] = bestMove.score+1;
.... return alpha;

Is this the "proper" way to implement killer moves?  Would it be better to set
the score of the move to +INF after a cutoff?   Is there a better structure I
can use other than an int array?

Thanks,
Rick



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.