Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Trabalho 7
- ao_lado(X, Y, L) :- nextto(X, Y, L).
- regra1(E) :-
- nth0(0, E, f);
- nth0(1, E, f);
- nth0(2, E, f).
- regra2(E) :-
- ao_lado(h, g, E).
- regra3(E) :-
- nth0(1, E, l);
- nth0(2, E, l);
- nth0(3, E, l);
- nth0(4, E, l);
- nth0(5, E, l).
- regra4(E) :-
- nth0(0, E, m);
- nth0(6, E, m).
- regra5(E) :-
- nth0(4, E, p);
- nth0(5, E, p);
- nth0(6, E, p).
- dengue(D) :-
- D = [_,_,_,_,_,_,_],
- Casas = [f,g,h,l,m,p,t],
- permutation(Casas, D),
- regra1(D),
- regra2(D),
- regra3(D),
- regra4(D),
- regra5(D).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement