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!

Search results for query: *

  1. MstrOfPppts

    multiply 2 number

    Maybe you wish to say that: % multLista of empty list is 0 multLista([],0). But than you have to add another edge case so your recursion would work: multLista([A],A).
  2. MstrOfPppts

    List Manipulation Question

    And you can also add: function([],_,[]). So that empty list returns empty list ...
  3. MstrOfPppts

    List Manipulation Question

    Solution: % When down to one if A is member of M the result % is empty list function([A],M,[]):- member(A,M). % else A is in the result function([A],M,[A]):- \+member(A,M). % when more than one, make function of tail and simply % return L1 because H is member of M function([H|T],M,L1):-...
  4. MstrOfPppts

    Creating a list of lists

    The problem with the lists is that you almost always have to take the recursively! Here is the solution: % Edge case: 1 element turns into a list with one element regroup([A],[[A]]). % Every next element it cheks all the memebers of list LL1 you get from Tail and checks if their members are...

Part and Inventory Search

Back
Top