Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: more help with move generator

Author: Joshua Haglund

Date: 15:11:04 01/16/03

Go up one level in this thread


On January 16, 2003 at 06:39:35, Lieven Clarisse wrote:

>This should bring you a little closer to your goal, it is by no means a working
>example, but will show you how to get started.
>
>
>#include <string.h>
>
>
>{
>moves[3]= {"e2e4", "d2d4", "c2c4"}; //I assume these are the legal moves
> //the current position
>
>//---> better and more general is this:
>
>generatemoves(boardrepresentation, moves);
>//boardrepresentation can be any object reprenting the current board position
>//moves is defined by char moves[100][10] (place for 100 moves)
>
>getline(input);
>
>if (!strcmp(input,moves[0]) || !strcmp(input,moves[1]) !strcmp(input,moves[2]))
>//you probably want this in a seperate function, using a for loop
> //so you can use it in general, using any number of moves
> {
> domove(boardrepresentation, input);
> move=evaluate_board(boardrepresentation);
> }
>
>else cout <<"invalid move" << endl;
>
>return move;     // reply move to be displayed from the evaluated position.
>}
Thanks for the help! I will see if I can work with that :)

Credit is given, where credit is due!

Joshua
toneewa@yahoo.com



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.