I have a solution for an instance of langford's numbers problem, and I want to generalize it, but I'm lacking some prolog tools.
For n=3 and k=2
I would write a predicate as following:
sequence([_,_,_,_,_,_]).
solve(L):-
sequence(L),
sublist([3,_,_,_,3],L),
sublist([2,_,_,2],L)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.