Reputation: 3
I have two lists, for example:
L1=[1,0,1,0,1,1]
L2=[2,3,4,2,1,1]
and I want to check something like this
if (L1[k]==0)
sum=L2(k)
Is there any way to do that using prolog?
Upvotes: 0
Views: 71
Reputation: 4670
nth0(Ind, Lst, Elem) enables random access to the list elements under SWI-Prolog
Upvotes: 1