Author: Sune Fischer
Date: 01:44:14 11/09/02
First Question: I want to support some variants of chess, mostly fischer-random. For this I need a member function pointer to point to a member function. I must have the syntax wrong cause the compiler complains, this is what I do: class BOARD { public: void (*pGenCastleMoves)(); // is this correct declaration? void GenNormalCastleMoves(); void GenFischerCastleMoves(); ... } I try and intialise it by: void GAME::SetNormal() { variant=NORMAL; Chessboard.pGenCastleMoves=Chessboard.GenNormalCastleMoves; } Where GAME is a different class that controls settings for the entire game, like the variant. It doesn't work though, I get: error C2440: '=' : cannot convert from 'void (__thiscall BOARD::*)(void)' to 'void (__cdecl *)(void)' There is no context in which this conversion is possible I have tried variations, like: BOARD::pGenCastleMoves=BOARD::GenNormalCastleMoves; doesn't work either. What am I doing wrong? Second Question: I just added promotion moves to my q-search, now I face the problem of getting them sorted in SEE. SEE seems to have a bit of a problem with that when the value of the defenders and attackers aren't constant. Eg. here the promotion move actually changes material value to (Queen-Pawn)+Rook, this is better than the knight move which only wins a queen. [D]5r2/1q2P3/8/N7/8/8/8/K6k w - - 0 1 Now, changing the pawn value to a queen won't work because it might be good to do the promotion even if the promoted piece is lost, we want to it to understand that it can't possibly lose more than a pawn, but can potentially win a queen plus captured material. [D]5r2/1n2P3/7b/N7/8/8/8/K6k w - - 0 1 Finally, there is no need for the move to be a capture at all, like here capturing the knight is better than promoting, but only a SEE would see this. [D]7r/1n2P3/8/N7/8/8/8/K6k w - - 0 1 I haven't been able to find a good fix for this, seems the SEE must be rewritten completely? Third Question: When on ICC, how do you re-seek for new games automaticly after a game. Is this something you have the engine do, or are there ICC commands? Is it possible to issue more commands on the same line, perhaps like icc>command1;command2;command3 ? Thanks, Sune
This page took 0.01 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.