Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :- module(reversi, [verifyState/5]).
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- verifyState(State,Player,NextPlayer,Board,OtherPlayer):-
- show(Board),
- (
- State = win, !, % If Player win -> stop
- nl, write('End of game : '),
- write(Player), write(' win !'), nl, nl
- ;
- State = draw, !, % If draw -> stop
- nl, write('End of game : '),
- write(' draw !'), nl, nl
- ;
- % Else -> continue the game
- play([NextPlayer, play, Board], OtherPlayer) % Else -> continue the game
- ).
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Advertisement
Add Comment
Please, Sign In to add comment