Result in an argument isn't correct
- by Paulo Nunes
So I have this piece of prolog code:
my_avalia(A,R) :- A=="Koza" -koza(R,0,0,e,89).
koza(R,_,_,_,87):-!,write(R).
koza(R,X,Y,V,C):-movex(V,X,X1),movey(V,Y,Y1),confirma(X1,Y1,Z),Z==1->(append(R,[emFrente],U),L is (C-1),koza(U,X1,Y1,V,L)).
The matter is that when I write the "R" at koza(), it has the correct values, however it ends up with a empty list in my_avalia when I call it like this:
my_avalia("Koza",R).
My recursion might be incorrect but I don't really know what's wrong with it.
Thanks in advance.