I'm doing a prolog program for college that is a bit like the cluedo game. I have six suspects with different traits:
suspect(Name, Age, Weapon, Shape, Object, Shoes)
The goal is to implement a series of clues so that the program says which the different traits of all the six suspects. For example:
suspect(Hannibal Lecter,67,knife,'in good shape',mac,'high heels')
I'm having problems trying to implement the clue
or(suspect1, suspect2, suspect3, listOfSuspects)
This clue is supposed to say that the suspect1
has the same traits as suspect2
OR as suspect3
but not both. Example: To indicate that the suspect who is 50 years old has a ring or a mac, but not both:
or(suspect(_, 50, _, _, _, _),
suspect(_, _, _, _, ring, _),
suspect(_, _, _, _, mac, _), listOfSuspects).
Any help would be appreciated.
See Question&Answers more detail:
os