Basic Lone King Mates?

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Re: Basic Lone King Mates?

Postby Steve Maughan » 31 Mar 2006, 00:04

Just a quick update. Many thanks to all those who replied. Monarch can now mate a lone king with Q, R, B+B and B+N. It was an interesting exercise and a little more complex than I had imagined. For those that are interested my solution only used a bonus for the aggressor's king in the centre and a penalty for the lone king in the center, with additional smaller penalties for incorrect corner in the case of B+N.

Steve
Steve Maughan
 
Posts: 48
Joined: 06 Oct 2004, 17:40
Location: Florida USA

Re: Basic Lone King Mates?

Postby H.G.Muller » 31 Mar 2006, 08:43

And how deep does the search have to be to find these mates, with such an evaluation?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Basic Lone King Mates?

Postby Tord Romstad » 31 Mar 2006, 11:45

H.G.Muller wrote:And how deep does the search have to be to find these mates, with such an evaluation?


My program needs 5 plies of search to win KBN vs K against Fruit 2.1. I am not sure 5 plies would be enough to win against TB defence, but I would be surprised if one or two extra plies would not be sufficient. Even at 7 plies, the whole game takes less than 5 seconds, so I don't consider it a problem.

I use the following very simple eval for KBN vs K:

Code: Select all
int DistanceBonus[8] = {0, 0, 100, 80, 60, 40, 20, 10};

uint8 KBNKtable[128] = {
  200, 190, 180, 170, 160, 150, 140, 130, 0, 0, 0, 0, 0, 0, 0, 0,
  190, 180, 170, 160, 150, 140, 130, 140, 0, 0, 0, 0, 0, 0, 0, 0,
  180, 170, 155, 140, 140, 125, 140, 150, 0, 0, 0, 0, 0, 0, 0, 0,
  170, 160, 140, 120, 110, 140, 150, 160, 0, 0, 0, 0, 0, 0, 0, 0,
  160, 150, 140, 110, 120, 140, 160, 170, 0, 0, 0, 0, 0, 0, 0, 0,
  150, 140, 125, 140, 140, 155, 170, 180, 0, 0, 0, 0, 0, 0, 0, 0,
  140, 130, 140, 150, 160, 170, 180, 190, 0, 0, 0, 0, 0, 0, 0, 0,
  130, 140, 150, 160, 170, 180, 190, 200, 0, 0, 0, 0, 0, 0, 0, 0
};

int kbnk_eval(const position_t *pos) {
  int winner, loser;
  int wksq, bksq, bsq, nsq, sign;
 
  winner = pos->material[WHITE]? WHITE : BLACK;
  loser = winner^1;
  sign = (winner == pos->side)? 1 : -1;
 
  wksq = KingSquare(pos, winner); bksq = KingSquare(pos, loser);
  bsq = BishopListStart(pos, winner); nsq = KnightListStart(pos, winner);

  if((file(bsq) + rank(bsq)) % 2) {
    wksq ^= 7; bksq ^= 7; bsq ^= 7; nsq ^= 7;
  }
 
  return sign*(KNOWN_WIN + DistanceBonus[Distance[wksq-bksq]] +
               KBNKtable[bksq]);
}

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway

Re: Basic Lone King Mates?

Postby Steve Maughan » 31 Mar 2006, 15:46

H.G.Muller wrote:And how deep does the search have to be to find these mates, with such an evaluation?


Not too much. Monarch is able to mate with B+N at 1 min / game + 1 sec / move against tablebase defence.

Regards,

Steve
Steve Maughan
 
Posts: 48
Joined: 06 Oct 2004, 17:40
Location: Florida USA

Previous

Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 4 guests