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 Chris Miller 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. MrAdamWest

    Arithmatic on Lists

    Thank you all for your help, I've used bits from all comments! Adam
  2. MrAdamWest

    Arithmatic on Lists

    Thanks for your help. So far I have minus(X,Y) :- Y > X, fail. minus(X,Y) :- Y is X-1; minus(X,Y) :- Y is X-2; minus(X,Y) :- Y is X-3. but I'm not sure how to implement this using a list of numbers. I have a list [9,8,7,3] and I want to see all the moves available if minus is a move. I think...
  3. MrAdamWest

    Arithmatic on Lists

    Is there anyway to use only 2 arguments?
  4. MrAdamWest

    Arithmatic on Lists

    Sorry after reading it again its not clear at all. If I state 1 bit it might be easier. I have a list [9,8,7,3] or along those lines. I need a predicate minus(A,B) which will list the moves possible. The only moves can be to subtract 4 or 2 so i would get the answer A = 9 B = 5 ; A = 9 B =...
  5. MrAdamWest

    Arithmatic on Lists

    This may be a simple problem but I am completely new to prolog. I am attempting to generate a predicate minus(A,B) where A is an initial state in a list [7,3,12,1] and B is what i am attemping to get to. So minus[7,3] would be acceptable. however i can only minus the numbers 4 and 2 so [7,4] is...

Part and Inventory Search

Back
Top