Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

All combinations of a list

Status
Not open for further replies.

gillyuk

Programmer
Nov 30, 2002
3
GB
i have been trying to find all possible combinations of a list given to me. This is the program i have at the moment but i can't see why it doesn't work. Please Could Someone help me.


swap([],[]).

swap([H|[H1|T]],[H1|[H|T1]]):-
swap(T,T1).


move(List,New):-
swap(List,New1),
New is New1.

ANY IDEAS WOULD BE GREAT Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top