CS代考程序代写 :- [‘chess_check’].
:- [‘chess_check’].
test :-
test1, test2, test3, test4, test5,
test6, test7, test8, test9, test10.
test1 :-
game_state(
[
black-king@b-1,
white-rook@c-3
], black, S),
write(“#1 should be in_play: “), write(S), nl.
test2 :-
game_state(
[
black-rook@a-1,
black-bishop@h-7,
white-bishop@a-6,
white-rook@d-1,
black-queen@e-4,
black-bishop@h-7,
white-king@d-2
], white, S),
write(“#2 should be in_play: “), write(S), nl.
test3 :-
game_state(
[
black-king@b-1,
white-queen@b-2
], black, S),
write(“#3 should be check: “), write(S), nl.
test4 :-
game_state(
[
black-king@b-1,
white-rook@b-3
], black, S),
write(“#4 should be check: “), write(S), nl.
test5 :-
game_state(
[
white-king@d-2,
white-bishop@a-6,
black-queen@d-3,
black-rook@a-1,
black-bishop@h-7
], white, S),
write(“#5 should be check: “), write(S), nl.
test6 :-
game_state(
[
white-king@e-5,
black-bishop@a-1,
black-rook@d-1,
black-rook@f-8,
black-queen@b-4,
black-bishop@h-3,
white-rook@a-8
], white, S),
write(“#6 should be check: “), write(S), nl.
test7 :-
game_state(
[
black-king@c-1,
white-queen@a-1,
white-rook@a-2
], black, S),
write(“#7 should be checkmate: “), write(S), nl.
test8 :-
game_state(
[
white-king@d-2,
black-queen@d-3,
black-rook@a-1,
black-bishop@h-7
], white, S),
write(“#8 should be checkmate: “), write(S), nl.
test9 :-
game_state(
[
white-king@e-5,
black-bishop@a-1,
black-rook@d-1,
black-rook@f-8,
black-queen@a-4,
black-bishop@h-3
], white, S),
write(“#9 should be checkmate: “), write(S), nl.
test10 :-
game_state(
[
white-king@e-5,
black-bishop@a-1,
black-rook@d-1,
black-rook@f-8,
black-queen@a-4,
black-bishop@h-3,
white-rook@a-8
], white, S),
write(“#10 should be checkmate: “), write(S), nl.