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 Mike Lewis 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. Kazzal

    Increase variable X by 1

    Thankyou.
  2. Kazzal

    Increase variable X by 1

    Is there an increment function. Or is there count function that could be used to count whether something exists in a list of clauses.?
  3. Kazzal

    Make a variable to a string

    Working a charm now I replaced bagof with the function findall and it works great :) Thankyou for all your help.
  4. Kazzal

    Make a variable to a string

    When I am running that code it is stil only displaying the first car clause. So for this cars('Camery','Hiyundi','1980',500,'2l'). I want the fourth paramater the 500 in this case to be compared against all the other cars power and then show the least powered car. So it would show when i run...
  5. Kazzal

    Make a variable to a string

    Ok, when i run the program and try the least, it is only displaying the first one of these cars('Camery','Hiyundi','1980',500,'2l'). cars('Ford XL','Hiyundi','1950',900,'5l'). cars('Tourino','Ford','1920',450,'3l'). cars('Wagon','Ford','1975',1020,'2l'). cars('V8...
  6. Kazzal

    Make a variable to a string

    I meant in the previous post, its not ordering them its only giving the list without it being the least powerful car. Its only showing the first clause of cars regardless that it isn't the last powerful car....
  7. Kazzal

    Make a variable to a string

    It does not seem to be working however, it is only outputting the first car.. Also can you please explain bagof() Wow I didn't realize there was those functions... Is their a good place to learn these function and that explains them for SWI-prolog. Cheers, Kazzal
  8. Kazzal

    Make a variable to a string

    Also I am using SWI-prolog.
  9. Kazzal

    Make a variable to a string

    I don't understand though its still not working, It gives no error now which is great but it does not seem to be proceeding with this line. Z is P, here is the code updated once again % finds the least powerful car. least:- write('The least powerful car is '), Z is 1, N = car, !, nl...
  10. Kazzal

    Make a variable to a string

    I am having trouble with this code, are you able to assign a variable to a string or is IS reserved for a comparison or something? Here is the code, Im just trying to make the internal goal "least" show the least powerful car. % cars/5. % cars(BRAND,MANUFACTURER,YEAR,POWER,ENGINE)...

Part and Inventory Search

Back
Top