On 11-May-2013 16:33:37 Srdjan Todorovic wrote:
On 11 May 2013 12:23, Ted Harding Ted.Harding@wlandres.net wrote:
I have a query. Is there some program which, given a Chess position and which player has the move, can output a (preferably numbered) list of the possible moves for that player in that position?
The only thing I can think of is having a look at 'gnuchess'. There's no useful man page, but the info page lists some stuff that could be of help.
I ran xboard (gnuchess frontend perhaps?) and it has some options that could be useful for setting up a board visually, and also seems to output a list of possible moves at each stage for the computer player.
This suggests that perhaps with enough tinkering, it could do what you want.
Regards, Srdjan
Thanks Srdjan (and thanks Anton Anyshon for comments also :)!
Thanks to your hint, I found out that if you enter "show moves" when it's your turn it will then list the available moves. Then you can pick.
The background to my query is that I've had the notion of playing against the computer using a program which selects its move more or less randomly (including completely randomly). For that I need a list of available moves to feed to the program each time it's the program's turn to move. And there it is! (Saves having to type them all in every time).
Non-uniform randomness could include giving different weights to possible moves by King, Queen, Rooks, Knights, Bishops, Pawns.
Anyway, that's a start, and thanks to you both! Ted.
------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@wlandres.net Date: 11-May-2013 Time: 18:15:27 This message was sent by XFMail -------------------------------------------------