Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dominos([(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6),
- (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6),
- (2, 2), (2, 3), (2, 4), (2, 5), (2, 6),
- (3, 3), (3, 4), (3, 5), (3, 6),
- (4, 4), (4, 5), (4, 6),
- (5, 5), (5, 6),
- (6, 6)]).
- frame([ [3, 1, 2, 6, 6, 1, 2, 2],
- [3, 4, 1, 5, 3, 0, 3, 6],
- [5, 6, 6, 1, 2, 4, 5, 0],
- [5, 6, 4, 1, 3, 3, 0, 0],
- [6, 1, 0, 6, 3, 2, 4, 0],
- [4, 1, 5, 2, 4, 3, 5, 5],
- [4, 1, 0, 2, 4, 5, 2, 0] ]).
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- put_dominos():-
- dominos(Dominos),
- frame(Frame),
- possible_positions(Dominos, Frame, Positions),
- place_dominos(Dominos, Positions, Result),
- print().
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- get_values((X, Y), X, Y).
- possible_positions([], _, _).
- possible_positions([X|Y], Frame, L) :-
- get_values(X, A, B),
- append([], X, L),
- row_pos(),
- column_pos().
- check_row(_, [], _, _).
- check_row(index, [H|T], X, Y) :-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement