Single legal move - what to do?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Bill Rogers
Posts: 3562
Joined: Thu Mar 09, 2006 3:54 am
Location: San Jose, California

Re: Single legal move - what to do?

Post by Bill Rogers »

This does not make any sense to me. If at the root you are in check and have only one legal move then you have no choice but to make that move. If during the search you make that move then you might be able to extend your search to as many plys as possible if the board allows it.
Bill
tvrzsky
Posts: 128
Joined: Sat Sep 23, 2006 7:10 pm
Location: Prague

Re: Single legal move - what to do?

Post by tvrzsky »

Bill Rogers wrote:This does not make any sense to me. If at the root you are in check and have only one legal move then you have no choice but to make that move. If during the search you make that move then you might be able to extend your search to as many plys as possible if the board allows it.
Bill
Oops, I was not correct in my statement because I have not worked on my program almost one year so I am not aware what it does anymore ... In fact 2 ply extension applies in the case that total amount of extensions in the current variant to the point is less than 5 plies, otherwise extension is only one ply.
And why? This is the way to avoid some pathological cases - mostly positions where queen can give series of checks and search tree blows up out of control.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Single legal move - what to do?

Post by bob »

jwes wrote:If there is a single legal move at the root, you could just make the move and start pondering.
The only minor issue is to find something to ponder if you don't do some sort of an abbreviated search before playing the only legal move...
Rein Halbersma
Posts: 741
Joined: Tue May 22, 2007 11:13 am

Re: Single legal move - what to do?

Post by Rein Halbersma »

bob wrote:
jwes wrote:If there is a single legal move at the root, you could just make the move and start pondering.
The only minor issue is to find something to ponder if you don't do some sort of an abbreviated search before playing the only legal move...
Why do that abbreviated search *before* making the legal move? Doing it on your opponents time makes more sense. And people doing 'ponder the position' don't have to make any adjustments :)
plattyaj

Re: Single legal move - what to do?

Post by plattyaj »

Rein Halbersma wrote:Why do that abbreviated search *before* making the legal move? Doing it on your opponents time makes more sense. And people doing 'ponder the position' don't have to make any adjustments :)
Bob didn't say you did it before you made the move ... Schola does it first thing in the ponder code if it doesn't have a move from the PV.

Andy.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Single legal move - what to do?

Post by bob »

Rein Halbersma wrote:
bob wrote:
jwes wrote:If there is a single legal move at the root, you could just make the move and start pondering.
The only minor issue is to find something to ponder if you don't do some sort of an abbreviated search before playing the only legal move...
Why do that abbreviated search *before* making the legal move? Doing it on your opponents time makes more sense. And people doing 'ponder the position' don't have to make any adjustments :)
First, I didn't say you had to do it before. I simply said you might want to unless you have some other way to choose a move to ponder.

As far as "ponder the position" goes, the idea is flawed and there are better ways to ponder, period, than to use a methodology that offers minimal help with time.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Single legal move - what to do?

Post by bob »

plattyaj wrote:
Rein Halbersma wrote:Why do that abbreviated search *before* making the legal move? Doing it on your opponents time makes more sense. And people doing 'ponder the position' don't have to make any adjustments :)
Bob didn't say you did it before you made the move ... Schola does it first thing in the ponder code if it doesn't have a move from the PV.

Andy.
Personally, in Crafty I do a hash probe first. If I get a hit with a best move, I ponder that (assuming I have no PV second move for whatever reason). If the hash probe fails, I then do a search (1/10th the usual time) to find a move to ponder.

While in book there are other tricks I use to avoid "doing nothing" while in book.