1
How do we fix this? I am trying to make a program that receives a path and translates in directions to follow (up(0),right(90),left(270),low(180)). The predicate vizinha
of the Dir
one of the directions (0,90,180,270), for example: test([ (5, 5), (5, 6), (6, 6), (6, 7), (7, 7)],L).
should give L=[0,90,0,90]
, but of L=[0]
. I made trace and this 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).
Hello, this is the Portguese Stackoverflow, for questions in English Please, go to the http://stackoverflow.com.
– Giovane