Skip to content
Prolog program that solves Einstein's riddle
Branch: master
Clone or download
Latest commit 87ca91d Oct 30, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Update README.md Oct 30, 2018
einstein.pl First commit Oct 30, 2018

README.md

Einstein's riddle

The following puzzle is said to be invented by Einstein. Supposedly, he also claimed that only 2% of the world’s population would be smart enough to solve it.

  1. There are 5 houses in 5 different colors in a row.
  2. In each house lives a person with a different nationality.
  3. These 5 owners drink a certain drink, smoke a certain brand of cigar, and keep a certain pet.
  4. No owners have the same pet, smoke the same brand of cigar or drink the same drink.

The question is: WHO OWNS THE FISH?

HINTS:

  • the Brit lives in the red house
  • the Swede keeps dogs as pets
  • the Dane drinks tea
  • the green house is on the immediate left of the white house
  • the green house owner drinks coffee
  • the person who smokes Pall Mall rears birds
  • the owner of the yellow house smokes Dunhill
  • the man living in the house right in the center drinks milk
  • the Norwegian lives in the first house
  • the man who smokes blends lives next to the one who keeps cats
  • the man who keeps horses lives next to the one who smokes Dunhill
  • the owner who smokes Bluemaster drinks beer
  • the German smokes prince
  • the Norwegian lives next to the blue house
  • the man who smokes blends has a neighbor who drinks water

Open einstein.pl in your favorite Prolog environment and type:

einstein.

You can’t perform that action at this time.