Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Legal moves generation

Author: Marek Mahdal

Date: 05:31:15 04/28/02

Go up one level in this thread


On April 27, 2002 at 13:50:50, Russell Reagan wrote:

>On April 27, 2002 at 11:15:00, Marek Mahdal wrote:
>
>>Hi everybody !
>> Can somebody help me to find a function, which will generate all possible legal
>>moves for a given position (any chessboard representation) in PHP or any other
>>scripting non-type programming language ? I am not looking for a chess engine,
>>only for the move generatino routine.
>>
>>Example:
>>input parameters could be:
>>
>>- current chessboard representation
>>- ep status
>>- castle status
>>- maybe history of moves
>>
>>output:
>>- array of all possible move in the given position.
>>
>>Thank you a lot !
>>
>>Marek Mahdal, Slovakia
>
>This depends on your specific needs. For example, do you want a list of 100%
>legal moves? Most chess programs don't generate all of the legal moves. For
>example most don't detect pinned pieces and often move them, and they catch them
>when they make the move and see that the side not to move is in check. So if you
>want 100% legal moves you'd have to either write a pin detection function or a
>function to make a move, find if one of the king's is in check, and eliminate
>the illegal moves.
>
>I assume that you're trying to do some kind of web interaction. If that is the
>case, I would suggest writing this in C or C++ and maybe write a script that
>will parse the form data, then call the C/C++ program and store it's output in a
>variable, then output it back to the user. That's what I would do rather than
>write this kind of thing in a scripting language.
>
>Russell

I need 100% legal moves, that means I need to make the move() and unmove()
functions.
Thank you for your suggestion with the C module. It will be definetely the best
solution, but I have no clue of C++. That's why I am asking for help in
scripting languages. Another problem is that my provider will not allow me to
run C/C++ programs on the server, nor running a deamon, or socket reading. So I
really needs to be done in some kind of scripting language.

Sincerely,
Marek Mahdal, Slovakia



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.