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. berghallen

    Need help with a task.

    Getting an error now: 8 ?- buy(X, L). ERROR: >/2: Arguments are not sufficiently instantiated And the code looks like this now. kopa(X, [ingredient(_,_)|TS], R) :- kopa(X, [ingredient(_,_)|TS], R).
  2. berghallen

    Need help with a task.

    Sorry but it wont work :( The task is to show everything I need to buy to cook for exempel rise. The code: buy(X, L) :- at_home(YS), recipe(X,XS), kollabuy(XS, YS, L). kollabuy([], _, []). kollabuy([X|XS], YS, L1) :- kollabuy(XS, YS, L), kopa(X, YS, R), ( R = [], L1 = L, ! ; L1 = [R | L])...
  3. berghallen

    Need help with a task.

    Okey, so how is it supposed to be in the code?
  4. berghallen

    Need help with a task.

    But R is supposed to be the answer?
  5. berghallen

    Need help with a task.

    Kollabuy is only there to look if any more ingredients need to be checked? And it is doing it in a recurive way? Aint I correct?
  6. berghallen

    Need help with a task.

    Thanks for reply, but I'm not getting it to work :/ buy(X, L) :- at_home(YS), recipe(X,XS), kollabuy(XS, YS, L). kollabuy([], _, _). kollabuy([X|XS], YS, L) :- kopa(X, YS, L), kollabuy(XS, YS, L). %No : when the homelist is empty, you have not foud the ingredient, you need to buy it and know...
  7. berghallen

    Need help with a task.

    I have write a program in Prolog, that will look in a list of ingredients and compare if you need to buy or what you can cook with all the ingredients you got home. I have finish the first one that looks if I can cook for example rise. But I need to write a program that calculate how much I...

Part and Inventory Search

Back
Top