Greetings All!
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?
Ideally, it should be possible to enter the position by placing pieces on an image of the board (and to change the position by moving pieces, e.g., after a move, by making the move).
With thanks, and best wishes to all, Ted.
------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@wlandres.net Date: 11-May-2013 Time: 12:23:02 This message was sent by XFMail -------------------------------------------------
On 11/05/13 12:23, (Ted Harding) wrote:
Greetings All!
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?
Ideally, it should be possible to enter the position by placing pieces on an image of the board (and to change the position by moving pieces, e.g., after a move, by making the move).
Frayed knot, but I shall watch this with interest. I used to play every weekday lunchtime, usually with a county player (I only ever beat him once...) and I think the last time I played regularly was in the Greyhound at Tibenham, 20 years ago.
In days of yore every paper had its chess problem, and I haven't seen one in years - I might have to change my paper.
Something to get the Brian ticking again?
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
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 -------------------------------------------------
On 11-May-2013 17:15:32 Ted Harding wrote:
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.
Well, here's round 1!
One awkward feature of the gnuchess "show moves" command is that, if the player is in check (so something has to be done about that right away), the moves displayed include all those which would be legal if the player was not in check!
So I've had to subset the list to those which are legal given that the player is in check, when this occurs. Then I've used a random number generator to choose a random move. Here is the first game in this tournament:
Mymove is : b5# 0-1{computer wins as black} White(15) : show game White Black 1. e4 Nc6 2. Qh5 Nf6 3. c3 Nxh5 4. h3 Nf6 5. Be2 Nxe4 6. Bd1 e5 7. Bh5 Qh4 8. g4 Qxf2+ 9. Kd1 Qf1+ 10. Kc2 Nf2 11. Bxf7+ Kxf7 12. Nf3 Qd3+ 13. Kb3 Qd5+ 14. Ka4 b5#
Well, it's a start! (And it didn't take long, even using manual input).
Ted.
------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@wlandres.net Date: 11-May-2013 Time: 19:15:29 This message was sent by XFMail -------------------------------------------------