Computer Chess Club Archives


Search

Terms

Messages

Subject: Chess Engine Move generator structure

Author: Joshua Shriver

Date: 16:43:17 03/07/04


What is the best way to store the data for a move generator?
Right now I'm implementing it as a tree:

struct ChessNode {
        int piece;
        int color;  /* 0 = white, 1 = black */
        struct ChessNode* one;
        struct ChessNode* two;
        struct ChessNode* three;
        struct ChessNode* four;
        struct ChessNode* five;
        struct ChessNode* six;
        struct ChessNode* seven;
        struct ChessNode* eight;
        struct ChessNode* nine;
        struct ChessNode* ten;
        struct ChessNode* eleven;
        struct ChessNode* twelve;
        struct ChessNode* thirteen;
        struct ChessNode* fourteen;
        struct ChessNode* fifthteen;
        struct ChessNode* sixteen;
        struct ChessNode* seventeen;
        struct ChessNode* eighteen;
};

Using all 18 pieces, since you can assume it should work with all 18 pieces
taken into consideration. However after x moves from the opening book, this
should bring that down a good bit.

I'm doing brute-force at the moment just to get into the swing of things before
implementing pruning. So this'll be rather weak.

Is this the best way to go about it? Or is there a more efficient way of holding
the data for a move generator if not a tree.

Sincerely,
Joshua Shriver
jshriver at csee dot wvu dot edu



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.