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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by g0blu322

  1. g0blu322

    Prolog Database Question

    Hi, So I'm trying to finish up a project for a class. It's a "dating database". It includes 5 males, and 5 females. I have to match them up using the following rules: (a) Only opposite sex can be matched (b) Male candidate should have a higher age than Female candidate (c) Male candidate should...
  2. g0blu322

    Absolute value

    I don't know what I did, but it works now. Thanks! All I did was re-save the program I did using notepad.
  3. g0blu322

    Absolute value

    ERROR: toplevel: Undefined procedure: sum/2 (DWIM could not correct goal)
  4. g0blu322

    Absolute value

    So this is my 2nd week learning prolog. I wrote a function to calculate the sum of a list of numbers. sum([], 0). sum([Head |Tail], TotalSum) :- sum(Tail, Sum1), TotalSum is Head + Sum1. So: input: ?- (sum([4,3,-5],X)) output: X=2 However, the goal is get the absolute value of the sum of the...

Part and Inventory Search

Back
Top