I recently started learning prolog in university(1 week in) and have a question!
So for example.
intersect([a,b,d], [b,c,a,l], L).
should output:
L=[a,b] or L=[b,a].
I've been trying for hours yet can't get it to work. I want to figure it out on my own, but I could really use some pointers in the right directions.
BTW: I'm only allowed to use member/2 as a built-in. I'm not allowed to use any other built-in predicates.
and you can do your question:
?- inters([a,b,d],[b,c,a,l],L).
as you see i 've removed all the spaces that you had in between the parameters.