Questions tagged [zebra-puzzle]

A Zebra-puzzle is a combinatorial logic puzzle. Also known as Einstein's riddle, Caliban's problem, Five Houses Puzzle.

A Zebra-puzzle is a combinatorial logic puzzle. Also known as Einstein's riddle, Caliban's problem, Five Houses Puzzle.

112 questions
0
votes
1 answer

How to solve this puzzle using prolog?

I am trying to solve this prolog puzzle and I am now stuck. I have tried writing different rules and solutions but it is not printing the solution. I am new to this language so any help would be greatly appreciated. I included what I have so far…
Zaywillaa
  • 27
  • 4
0
votes
2 answers

How to solve this puzzle with swiprolog?

I am trying to solve this puzzle using prolog and I am having difficulty writing down the rules and finishing the solution. This is the puzzle... Last weekend was the men’s annual bowling tournament, an event of competition and fun for the local…
Zaywillaa
  • 27
  • 4
0
votes
2 answers

How does this Zebra solution in prolog work?

zebra_owner(Owner) :- houses(Hs), member(h(Owner,zebra,_,_,_), Hs). water_drinker(Drinker) :- houses(Hs), member(h(Drinker,_,_,water,_), Hs). houses(Hs) :- length(Hs, 5), % 1 …
BlueRyse
  • 35
  • 4
0
votes
3 answers

Prolog program that finds the culprit of a crime given the following facts

Facts about the situation -- image (free online OCR:) The police are trying to track down the gang of three kids who have been steeling pumpkins. So far, they have established the following facts: the kids' first names are Angela, Mary, and David;…
Hani Salehi
  • 89
  • 1
  • 7
0
votes
1 answer

Einsteins puzzle in prolog

I have tried to solve the Einstein puzzle - five friend edition - in prolog, but Im stuck. I can't seem to find the error in my code, or what to do to solve it. The goal is to write a Prolog program that identifies correctly what kind of puzzle…
concat
  • 1
0
votes
1 answer

How to repair error in Einstein Zebra in prolog >

I have a problem with zebra puzzle. rightOf(A,B,(B,A,_,_,_)). rightOf(A,B,(_,B,A,_,_)). rightOf(A,B,(_,_,B,A,_)). rightOf(A,B,(_,_,_,B,A)). middleHouse(A,(_,_,A,_,_)). firstHouse(A,(A,_,_,_,_)). …
user12519116
0
votes
1 answer

Prolog Logic Puzzle Failure

I am attempting to solve the logic puzzle found here: https://www.braingle.com/brainteasers/teaser.php?id=23826&op=2&comm=1#c These are the clues: The flowers were purchased in the following order: tulips, the flowers for the office, the purple…
0
votes
2 answers

Prolog office puzzle

I'm attempting to do a Prolog assignment for school, and basically it's trying to find out who has what office. The question is: Hunter, Laura, Jim, Sally, and Jack work in the same building with five adjacent offices. Hunter doesn’t work in the 5th…
0
votes
2 answers

Variation of the zebra puzzle in prolog, and I can't figure out where I'm going wrong

I know the zebra puzzle is asked often here, but this is a bit different: We were given a variation of the zebra puzzle in Prolog to write. I'm super new to this, but I even tried getting help from some people last year who had themselves a…
kastaplastislife
  • 293
  • 2
  • 16
0
votes
0 answers

Prolog Member in Logic Puzzles

I'm new to Prolog and need some guidance *(not answers) to get in the right direction. Firstly, I'm trying to solve a logic puzzle. There are triples in the logic. I know how to create negations and members like the following: member ([_, X, _],…
0
votes
2 answers

How is the day of the week unicorn?

Task: The Unicorn is known to lie on Mondays, Tuesdays, and Wednesdays and tells the truth on all other days of the week. He can say: “Yesterday I lied. After tomorrow, I will lie for two days in a row. ” Determine the day of the conversation. I…
GOOse
  • 13
  • 2
0
votes
1 answer

Write a Prolog program to solve this problem

I am new to Prolog kindly assist. Hunter, Laura, Jim, Sally, and Jack work in the same building with five adjacent offices. Hunter doesn’t work in the 5th office and Laura doesn’t work in the first office. Jim doesn’t work in the first or last…
user4973012
0
votes
1 answer

Puzzle in Mozart Oz

I am trying to solve the below puzzle in Mozart oz. Susie loved animals and had a large collection of stuffed animals. However, there were several that were her favorites. She decided this morning to rearrange her stuffed animals and give each of…
0
votes
3 answers

prolog grid-based logic puzzle stuck

The puzzle goes like this: on an island there are 4 temples. Each temple has a name, location and date it was build. You get 4 clues to help you determine which 4 combinations (name, location, date) are correct. I have to solve this using prolog.…
0
votes
1 answer

prolog printing out same answer for different parameters

I am writing a Prolog program that solves a logic puzzle. When trying to print out the answers its gives me the same answers for all of them. The answers to the logic puzzle are: genevieve bought a size 4 manzarita lucia bought a size 7…
chris2656
  • 57
  • 2
  • 9