How to solve this? I'm trying to make a program that gets a path and translates in the following directions (up (0), right (90), left (270), down (180)). The predicate vizinha
of the Dir
one of the directions (0,90,180,270), example: test([ (5, 5), (5, 6), (6, 6), (6, 7), (7, 7)],L).
should give L=[0,90,0,90]
, but L=[0]
. I made trace and this is the link of the image The trace
test([(_,_)],_).
test([A|P],List):-
B=(_,_),
append([B],_,P),
vizinha(A,B,Dir),
append(List,[Dir],List1),
test(P,List1).