Solution for: prolog rule
I found out where I went wrong myself, here`s the solution for future Prolog victims:
code:
inventory(Part, Quant):- Quant < 10.
reorder(Part):-inventory(Part, Quant),Quant < 10, write('Time to reorder!').
result of prolog session:
code:
| ?-...
I am practicing some prolog, below is my code for a prolog predicate(rule) to check the inventory levels, so I try to write a reorder predicate which takes "Part" as an argument and print a message 'Time to reorder' if the inventory level is less than 10, it should normally print that, if it is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.