Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.46 KB | None | 0 0
  1. % lights_out_interactive.pl
  2.  
  3. :- module(lights_out_interactive, [
  4.                    read_and_write_solution/2,
  5.                    play/2
  6.                   ]).
  7.  
  8. :- use_module(lights_out_board).
  9. :- use_module(lights_out_io).
  10. :- use_module(combinations).
  11. :- use_module(lights_out_solver).
  12.  
  13. read_and_solve(W, H, Ms) :-
  14.     read_board(W, H, B),
  15.     solve(B, Ms).
  16.  
  17. read_and_write_solution(W, H) :-
  18.     read_and_solve(W, H, Ms), !,
  19.     write_solution(Ms).
  20.  
  21. play(W, H) :- read_and_write_solution(W, H).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement