RosettaCodeData/Task/Zebra-puzzle/00DESCRIPTION

33 lines
1.1 KiB
Text
Raw Permalink Normal View History

2015-02-20 00:35:01 -05:00
The [[wp:Zebra puzzle|Zebra puzzle]], a.k.a. Einstein's Riddle,
2019-09-12 10:33:56 -07:00
is a logic puzzle which is to be solved programmatically.
2013-04-11 01:07:29 -07:00
2019-09-12 10:33:56 -07:00
It has several variants, one of them this:
# There are five houses.
# The English man lives in the red house.
# The Swede has a dog.
# The Dane drinks tea.
# The green house is immediately to the left of the white house.
# They drink coffee in the green house.
# The man who smokes Pall Mall has birds.
# In the yellow house they smoke Dunhill.
# In the middle house they drink milk.
# The Norwegian lives in the first house.
# 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.
# The man who smokes Blue Master drinks beer.
# The German smokes Prince.
# The Norwegian lives next to the blue house.
# They drink water in a house next to the house where they smoke Blend.
2013-04-11 01:07:29 -07:00
2016-12-05 22:15:40 +01:00
<br>The question is, who owns the zebra?
2013-04-11 01:07:29 -07:00
2015-02-20 00:35:01 -05:00
Additionally, list the solution for all the houses.
Optionally, show the solution is unique.
2013-04-11 01:07:29 -07:00
2016-12-05 22:15:40 +01:00
;Related tasks:
* &nbsp; [[Dinesman's multiple-dwelling problem]]
* &nbsp; [[Twelve statements]]
<br><br>