Is there an engine to play the "Can I" variant ?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Tony Thomas

Re: Is there an engine to play the "Can I" variant

Post by Tony Thomas »

Vinvin wrote:
You didn't read enough carefully : "if he refuse you can play an other move of your choice."
Then that makes sense. I was under the impression that the only time you get to make a move without asking is if there is only one move.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Is there an engine to play the "Can I" variant

Post by hgm »

It is very easy to convert a normal engine to play this game. Just let alpha-beta maintain the score of the second-best move in every node, in stead of the best, as you assume the best will be vetoed.

So in stead of

Code: Select all

if(score > alpha) alpha = score;
You would do something like

Code: Select all

if(score > bestScore) { alpha = bestScore; bestScore = score; }
else if(score > alpha) alpha = score;
Uri Blass
Posts: 10300
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Is there an engine to play the "Can I" variant

Post by Uri Blass »

hgm wrote:It is very easy to convert a normal engine to play this game. Just let alpha-beta maintain the score of the second-best move in every node, in stead of the best, as you assume the best will be vetoed.

So in stead of

Code: Select all

if(score > alpha) alpha = score;
You would do something like

Code: Select all

if(score > bestScore) { alpha = bestScore; bestScore = score; }
else if(score > alpha) alpha = score;
I do not think that it is very hard but it is not so easy as you discribe.

Changing the score for moves is not enough because the engine should have also decide in some cases not to allow the opponent to move so practically the engine has more moves

For example after 1.e4 black has 21 moves when one of them is reject 1.e4 and the other moves are the possible moves so the move list needs to be bigger.

I do not know if your idea works for analysis when you are not allowed to take back the opponent move but even in case that it works you should have rules for analysis when take back is allowed.

I thought about different idea to implement the rules of the game but maybe your idea is better.

The idea of me was simply to tell the engine that it has the normal moves and one more move in part of the cases (The TakeBack move) when every 3 consecutive plies cannot include more than one takeback

Uri
tmokonen
Posts: 1296
Joined: Sun Mar 12, 2006 6:46 pm
Location: Kelowna
Full name: Tony Mokonen

Re: Is there an engine to play the "Can I" variant

Post by tmokonen »

George Tsavdaris wrote:
Vinvin wrote:I learn this game some years ago :
This game is very similar to chess, except that you have to ask your opponent to make a move, if he accept , you have to play the move, if he refuse you can play an other move of your choice. Remark : If only 1 move is possible , play it without asking.
Yes i knew this game and it's indeed very interesting. In contrast with Wael and Tony i find it not boring at all.... :lol:

Most probably Zillions of Games can play it....
This variant is more commonly known as Refusal Chess. Well, at least that's what it's called in R. Wayne Schmittberger's excellent book New Rules For Classic Games.

Here is a page with a simple little Java applet that plays the game.
http://www.pathguy.com/chess/RefusalC.htm

It doesn't appear that Zillions plays it out of the box, maybe some enterprising programmer can write a .zrf file to play this game.

Tony
Vinvin
Posts: 5228
Joined: Thu Mar 09, 2006 9:40 am
Full name: Vincent Lejeune

Re: Is there an engine to play the "Can I" variant

Post by Vinvin »

Many Thanks, Tony !
I just beat the applet at first game :-)
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Is there an engine to play the "Can I" variant

Post by hgm »

Uri Blass wrote:I do not think that it is very hard but it is not so easy as you discribe.

Changing the score for moves is not enough because the engine should have also decide in some cases not to allow the opponent to move so practically the engine has more moves

For example after 1.e4 black has 21 moves when one of them is reject 1.e4 and the other moves are the possible moves so the move list needs to be bigger.
This way you consider the refusal and take-back as separate plies, which I think is a bad idea. The whole action of proposing a move and then either playing it or it being refused and playing another should be considered a single ply. Then you get the algorithm I describe above.