:- prompt(_, '').
:- use_module(library(readutil)).
test([(_,_)],[]).
test([A|P],List):-
B=(_,_),
append([B],_,P),
vizinha(A,B,Dir),
append([Dir],List1,List),
test(P,List1).
/* Para testar */
vizinha((5,5),(5,6),0).
vizinha((5,6),(6,6),90).
vizinha((6,6),(6,7),0).
vizinha((6,7),(7,7),90).
main:-
process,
process:-
test([ (5, 5), (5, 6), (6, 6), (6, 7), (7, 7)],L),
:- main.
Oi0gc2V0X3Byb2xvZ19mbGFnKHZlcmJvc2Usc2lsZW50KS4KOi0gcHJvbXB0KF8sICcnKS4KOi0gdXNlX21vZHVsZShsaWJyYXJ5KHJlYWR1dGlsKSkuCgp0ZXN0KFsoXyxfKV0sW10pLgp0ZXN0KFtBfFBdLExpc3QpOi0KICAgIEI9KF8sXyksCiAgICBhcHBlbmQoW0JdLF8sUCksICAgICAKICAgIHZpemluaGEoQSxCLERpciksIAogICAgYXBwZW5kKFtEaXJdLExpc3QxLExpc3QpLCAKICAgIHRlc3QoUCxMaXN0MSkuCiAgICAKLyogUGFyYSB0ZXN0YXIgKi8Kdml6aW5oYSgoNSw1KSwoNSw2KSwwKS4Kdml6aW5oYSgoNSw2KSwoNiw2KSw5MCkuCnZpemluaGEoKDYsNiksKDYsNyksMCkuCnZpemluaGEoKDYsNyksKDcsNyksOTApLgoKbWFpbjotCglwcm9jZXNzLAoJaGFsdC4KCnByb2Nlc3M6LQoJdGVzdChbICg1LCA1KSwgKDUsIDYpLCAoNiwgNiksICg2LCA3KSwgKDcsIDcpXSxMKSwKCXdyaXRlKEwpLAoJbmwsCgl0cnVlLgoKOi0gbWFpbi4=