Skip to content

Commit c5b5533

Browse files
committed
we rotate the board again - fixed role exchange limit
1 parent a537bba commit c5b5533

File tree

5 files changed

+198
-45
lines changed

5 files changed

+198
-45
lines changed

BEISPIEL/lengthy/rollentausch.inp

Lines changed: 0 additions & 20 deletions
This file was deleted.

BEISPIEL/rollentausch.inp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,30 @@ forderung #4
2424
bedingung rollentausch
2525
option varianten
2626

27+
weiter
28+
29+
autor Wolfgang Erben
30+
bemerkung keine loesung, weil nur 1 rollentausch erlaubt ist
31+
steine weiss kh1 bb5d6g6 schwarz kc8 bd7g7
32+
bedingung rollentausch 1
33+
forderung #8
34+
option varianten ohnekurzvarianten
35+
36+
weiter
37+
38+
autor Wolfgang Erben
39+
steine weiss kh1 bb5d6g6 schwarz kc8 bd7g7
40+
bedingung rollentausch 2
41+
forderung #8
42+
option varianten ohnekurzvarianten
43+
44+
weiter
45+
46+
autor Wolfgang Erben
47+
steine weiss kh1 bb4d6g6 schwarz kd8 bd7g7
48+
bedingung rollentausch
49+
forderung #9
50+
option varianten ohnekurzvarianten
51+
2752
end
2853

REGRESSIONTESTS/rollentausch.out

Lines changed: 159 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
Rollentausch
2525

2626
1. Rollentausch ! Zugzwang.
27-
1...Kb8-a8
28-
2.Tc5-c8 #
27+
1...Kg1-h1
28+
2.Tf4-f1 #
2929

30-
add_to_move_generation_stack: 124
31-
play_move: 90
32-
is_white_king_square_attacked: 19
33-
is_black_king_square_attacked: 93
30+
add_to_move_generation_stack: 121
31+
play_move: 85
32+
is_white_king_square_attacked: 20
33+
is_black_king_square_attacked: 88
3434

3535
Loesung beendet.
3636

@@ -63,13 +63,13 @@ Loesung beendet.
6363
1.Df1-a6 + !
6464
1...Kb6*a6
6565
2. Rollentausch Zugzwang.
66-
2...Kb8-a8
67-
3.Tc5-c8 #
66+
2...Kg1-h1
67+
3.Tf4-f1 #
6868

69-
add_to_move_generation_stack: 18262
70-
play_move: 14559
71-
is_white_king_square_attacked: 9791
72-
is_black_king_square_attacked: 5687
69+
add_to_move_generation_stack: 18347
70+
play_move: 14340
71+
is_white_king_square_attacked: 9792
72+
is_black_king_square_attacked: 5480
7373

7474
Loesung beendet.
7575

@@ -106,13 +106,154 @@ Loesung beendet.
106106
2.Da4-a6 +
107107
2...Kb6*a6
108108
3. Rollentausch Zugzwang.
109-
3...Kb8-a8
110-
4.Tc5-c8 #
109+
3...Kg1-h1
110+
4.Tf4-f1 #
111111

112-
add_to_move_generation_stack: 124952
113-
play_move: 89359
114-
is_white_king_square_attacked: 55546
115-
is_black_king_square_attacked: 40222
112+
add_to_move_generation_stack: 125125
113+
play_move: 88636
114+
is_white_king_square_attacked: 55575
115+
is_black_king_square_attacked: 39510
116+
117+
Loesung beendet.
118+
119+
120+
keine loesung, weil nur 1 rollentausch erlaubt ist
121+
122+
Wolfgang Erben
123+
124+
+---a---b---c---d---e---f---g---h---+
125+
| |
126+
8 . . -K . . . . . 8
127+
| |
128+
7 . . . -B . . -B . 7
129+
| |
130+
6 . . . B . . B . 6
131+
| |
132+
5 . B . . . . . . 5
133+
| |
134+
4 . . . . . . . . 4
135+
| |
136+
3 . . . . . . . . 3
137+
| |
138+
2 . . . . . . . . 2
139+
| |
140+
1 . . . . . . . K 1
141+
| |
142+
+---a---b---c---d---e---f---g---h---+
143+
#8 4 + 3
144+
Rollentausch 1
145+
146+
add_to_move_generation_stack: 369191
147+
play_move: 333144
148+
is_white_king_square_attacked: 262837
149+
is_black_king_square_attacked: 72335
150+
151+
Loesung beendet.
152+
153+
154+
155+
Wolfgang Erben
156+
157+
+---a---b---c---d---e---f---g---h---+
158+
| |
159+
8 . . -K . . . . . 8
160+
| |
161+
7 . . . -B . . -B . 7
162+
| |
163+
6 . . . B . . B . 6
164+
| |
165+
5 . B . . . . . . 5
166+
| |
167+
4 . . . . . . . . 4
168+
| |
169+
3 . . . . . . . . 3
170+
| |
171+
2 . . . . . . . . 2
172+
| |
173+
1 . . . . . . . K 1
174+
| |
175+
+---a---b---c---d---e---f---g---h---+
176+
#8 4 + 3
177+
Rollentausch 2
178+
179+
1. Rollentausch ! Drohung:
180+
2.Kf1-e1 Drohung:
181+
3.Ke1-d1 Drohung:
182+
4.Kd1-c1 Drohung:
183+
5. Rollentausch Drohung:
184+
6.b5-b6 Drohung:
185+
7.b6-b7 Drohung:
186+
8.b7-b8=D #
187+
8.b7-b8=T #
188+
189+
add_to_move_generation_stack: 514391
190+
play_move: 459706
191+
is_white_king_square_attacked: 355193
192+
is_black_king_square_attacked: 107329
193+
194+
Loesung beendet.
195+
196+
197+
198+
Wolfgang Erben
199+
200+
+---a---b---c---d---e---f---g---h---+
201+
| |
202+
8 . . . -K . . . . 8
203+
| |
204+
7 . . . -B . . -B . 7
205+
| |
206+
6 . . . B . . B . 6
207+
| |
208+
5 . . . . . . . . 5
209+
| |
210+
4 . B . . . . . . 4
211+
| |
212+
3 . . . . . . . . 3
213+
| |
214+
2 . . . . . . . . 2
215+
| |
216+
1 . . . . . . . K 1
217+
| |
218+
+---a---b---c---d---e---f---g---h---+
219+
#9 4 + 3
220+
Rollentausch
221+
222+
1. Rollentausch ! Drohung:
223+
2.Ke1-d1 Drohung:
224+
3.Kd1-c1 Drohung:
225+
4.Kc1-b1 Drohung:
226+
5. Rollentausch Drohung:
227+
6.b4-b5 Drohung:
228+
7.b5-b6 Drohung:
229+
8.b6-b7 Drohung:
230+
9.b7-b8=D #
231+
9.b7-b8=T #
232+
233+
1.b4-b5 ! Drohung:
234+
2. Rollentausch Drohung:
235+
3.Ke1-d1 Drohung:
236+
4.Kd1-c1 Drohung:
237+
5. Rollentausch Drohung:
238+
6.b5-b6 Drohung:
239+
7.b6-b7 Drohung:
240+
8.b7-b8=D #
241+
8.b7-b8=T #
242+
1...Kd8-c8
243+
2. Rollentausch Drohung:
244+
3.Kf1-e1 Drohung:
245+
4.Ke1-d1 Drohung:
246+
5.Kd1-c1 Drohung:
247+
6. Rollentausch Drohung:
248+
7.b5-b6 Drohung:
249+
8.b6-b7 Drohung:
250+
9.b7-b8=D #
251+
9.b7-b8=T #
252+
253+
add_to_move_generation_stack: 1116084
254+
play_move: 1014753
255+
is_white_king_square_attacked: 787808
256+
is_black_king_square_attacked: 233902
116257

117258
Loesung beendet.
118259

conditions/depend

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9222,11 +9222,11 @@ conditions/role_exchange$(OBJ_SUFFIX): conditions/role_exchange.c \
92229222
position/effects/piece_removal.h solving/move_effect_journal.h \
92239223
position/castling_rights.h solving/ply.h position/pieceid.h \
92249224
position/effects/total_side_exchange.h position/effects/null_move.h \
9225-
solving/move_generator.h debugging/measure.h output/plaintext/protocol.h \
9226-
solving/pipe.h solving/fork.h solving/observation.h \
9227-
pieces/walks/vectors.h solving/temporary_hacks.h \
9228-
stipulation/structure_traversal.h stipulation/slice.h \
9229-
stipulation/slice_structural_type.h \
9225+
position/effects/board_transformation.h solving/move_generator.h \
9226+
debugging/measure.h output/plaintext/protocol.h solving/pipe.h \
9227+
solving/fork.h solving/observation.h pieces/walks/vectors.h \
9228+
solving/temporary_hacks.h stipulation/structure_traversal.h \
9229+
stipulation/slice.h stipulation/slice_structural_type.h \
92309230
stipulation/slice_structural_type.enum.h \
92319231
stipulation/slice_structural_type.enum \
92329232
stipulation/slice_functional_type.h \
@@ -9291,6 +9291,8 @@ position/effects/total_side_exchange.h:
92919291

92929292
position/effects/null_move.h:
92939293

9294+
position/effects/board_transformation.h:
9295+
92949296
solving/move_generator.h:
92959297

92969298
debugging/measure.h:

conditions/role_exchange.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "position/effects/piece_removal.h"
33
#include "position/effects/total_side_exchange.h"
44
#include "position/effects/null_move.h"
5+
#include "position/effects/board_transformation.h"
56
#include "solving/move_generator.h"
67
#include "solving/pipe.h"
78
#include "solving/fork.h"
@@ -81,10 +82,16 @@ void role_exchange_player_solve(slice_index si)
8182

8283
if (move_generation_stack[CURRMOVE_OF_PLY(nbply)].arrival==move_role_exchange)
8384
{
85+
assert(the_limit>0);
86+
--the_limit;
87+
8488
move_effect_journal_do_null_move(move_effect_reason_role_exchange);
89+
move_effect_journal_do_board_transformation(move_effect_reason_role_exchange,rot180);
8590
move_effect_journal_do_total_side_exchange(move_effect_reason_role_exchange);
8691

8792
fork_solve_delegate(si);
93+
94+
++the_limit;
8895
}
8996
else
9097
pipe_solve_delegate(si);
@@ -139,10 +146,8 @@ void role_exchange_generator_solve(slice_index si)
139146

140147
if (SLICE_STARTER(si)==White && the_limit>0)
141148
{
142-
--the_limit;
143149
push_role_exchange_move();
144150
pipe_solve_delegate(si);
145-
++the_limit;
146151
}
147152
else
148153
pipe_solve_delegate(si);

0 commit comments

Comments
 (0)