Zebra puzzle: Difference between revisions

Content added Content deleted
m (used list indentation.)
m (added whitespace.)
Line 1: Line 1:
[[File:zebra.png|550px||right]]
[[File:zebra.png|525px||right]]
{{task|Puzzles}}
{{task|Puzzles}}
[[Category:Constraint Handling Rules]]
[[Category:Constraint Handling Rules]]
Line 9: Line 9:


It has several variants, one of them this:
It has several variants, one of them this:
:# There are five houses.
:#   There are five houses.
:# The English man lives in the red house.
:#   The English man lives in the red house.
:# The Swede has a dog.
:#   The Swede has a dog.
:# The Dane drinks tea.
:#   The Dane drinks tea.
:# The green house is immediately to the left of the white house.
:#   The green house is immediately to the left of the white house.
:# They drink coffee in the green house.
:#   They drink coffee in the green house.
:# The man who smokes Pall Mall has birds.
:#   The man who smokes Pall Mall has birds.
:# In the yellow house they smoke Dunhill.
:#   In the yellow house they smoke Dunhill.
:# In the middle house they drink milk.
:#   In the middle house they drink milk.
:# The Norwegian lives in the first house.
:#   The Norwegian lives in the first house.
:# The man who smokes Blend lives in the house next to the house with cats.
:#   The man who smokes Blend lives in the house next to the house with cats.
:# In a house next to the house where they have a horse, they smoke Dunhill.
:#   In a house next to the house where they have a horse, they smoke Dunhill.
:# The man who smokes Blue Master drinks beer.
:#   The man who smokes Blue Master drinks beer.
:# The German smokes Prince.
:#   The German smokes Prince.
:# The Norwegian lives next to the blue house.
:#   The Norwegian lives next to the blue house.
:# They drink water in a house next to the house where they smoke Blend.
:#   They drink water in a house next to the house where they smoke Blend.


<br>The question is, who owns the zebra?
<br>The question is, who owns the zebra?


Additionally, list the solution for all the houses.
Additionally, list the solution for all the houses.
Optionally, show the solution is unique.
<br>Optionally, show the solution is unique.