How do I solve thisComo resolver isto? I'm trying to makeEu estou a programm that recievestentar fazer um programa que receba um caminho e traduz em direcoes a list of coordenatesseguir (a path) and translates it to directions cima(Im trying to do it with recursion0), the neighbor clause unifies D with the direction needed , examples: test([ direita(5, 590), esquerda(5, 6270), baixo(6, 6180), (6, 7),. O predicado vizinha
da a Dir
uma das direcoes(7, 7)],L). would give L=[0,90,0,90], but i get L=[0]. The trace is in the image.The trace
These are my predicates90, my neighbors predicate is without problem.
´test([(,)]180,_270).
test([A|P] ,List) exemplo:-
B=(,),
append([B],_,P),
neighbor(A,B,Dir),
append(List,[Dir],List1),
test(P test([ (5, 5), (5, 6), (6, 6), (6, 7), (7, 7)],L).
devia dar L=[0,90,0,90]
,List1) mas da L=[0]
. Fiz trace e esta ai o link da imagem O trace
test([(_,_)],_).
test([A|P],List):-
B=(_,_),
append([B],_,P),
vizinha(A,B,Dir),
append(List,[Dir],List1),
test(P,List1).