Mating with two bishops
Posted: Wed Mar 05, 2014 11:19 am
Hi!
I am developing a java chess engine and have some problem getting it to play accurate when mating with two bishops.
fen: 8/8/8/7B/5k1B/8/8/K7 w - - 0 1
My evaluator gives credits if weak king is near the edge (Mating score) plus it gives score if stronger king is near the waker king.
My problem is that the the engine plays real bad ... i.e. it plays far from optimal.
E.g.: (Search depth = 7)
Failed to solve position: 8/8/8/7B/5k1B/8/8/K7 w - - 0 1 Mate in 30 moves.
1.Ka2 Kf5 2.Kb3 Kf4 3.Kb4 Kf5 4.Kb5 Kf4 5.Bf6 Kf5
6.Bd8 Kf4 7.Bg6 Kg4 8.Kc5 Kg3 9.Bc7+ Kg4 10.Kd5 Kg5
11.Be4 Kh6 12.Bf4+ Kh5 13.Bf3+ Kh4 14.Be2 Kh3 15.Bf3 Kh4
16.Be2 Kh3 17.Ke4 Kh4 18.Bd3 Kh5 19.Kf3 Kh4 20.Bc4 Kh5
21.Bf7+ Kh4 22.Be3 Kh3 23.Be6+ Kh4 24.Bf7 Kh3 25.Bf2 Kh2
26.Bg3+ Kh1 27.Kf4 Kg1 28.Kf3 Kh1 29.Bf4 Kg1 30.Ke2 Kg2
31.Be6
The only answer that I can come up with is that since only the leaf nodes are evaluated the engine gets the same score for moves even if they are worse.
I.e., Ka2 instead of Kb2 as the starting move.
I am developing a java chess engine and have some problem getting it to play accurate when mating with two bishops.
fen: 8/8/8/7B/5k1B/8/8/K7 w - - 0 1
My evaluator gives credits if weak king is near the edge (Mating score) plus it gives score if stronger king is near the waker king.
My problem is that the the engine plays real bad ... i.e. it plays far from optimal.
E.g.: (Search depth = 7)
Failed to solve position: 8/8/8/7B/5k1B/8/8/K7 w - - 0 1 Mate in 30 moves.
1.Ka2 Kf5 2.Kb3 Kf4 3.Kb4 Kf5 4.Kb5 Kf4 5.Bf6 Kf5
6.Bd8 Kf4 7.Bg6 Kg4 8.Kc5 Kg3 9.Bc7+ Kg4 10.Kd5 Kg5
11.Be4 Kh6 12.Bf4+ Kh5 13.Bf3+ Kh4 14.Be2 Kh3 15.Bf3 Kh4
16.Be2 Kh3 17.Ke4 Kh4 18.Bd3 Kh5 19.Kf3 Kh4 20.Bc4 Kh5
21.Bf7+ Kh4 22.Be3 Kh3 23.Be6+ Kh4 24.Bf7 Kh3 25.Bf2 Kh2
26.Bg3+ Kh1 27.Kf4 Kg1 28.Kf3 Kh1 29.Bf4 Kg1 30.Ke2 Kg2
31.Be6
The only answer that I can come up with is that since only the leaf nodes are evaluated the engine gets the same score for moves even if they are worse.
I.e., Ka2 instead of Kb2 as the starting move.