Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write a program to solve this puzzle.
#1
I found the following puzzle a bit of a head-scratcher, but got there in the end. What i'm interested in though is a computer program to solve it.

I think that it may be some kind of exact cover problem, that could be solved by Knuths DLX. Maybe it isn't though. I'm sure good use of Boolean Logic is the way to solve it though.

I'd love to see anyone's program. I started one but it was a bit brute-force, so i'm going to rethink.

There will be no time-limits, or even winners to this challenge, but you do get a smug face if you can do it, and that's what counts!

Code:
Neighbours

Five people of different nationality live in a row of five houses of different colour. Each person prefers a different beverage, smokes a different brand of cigar and keeps a different kind of animal. Can you figure out who owns the fish?

   1. The Brit lives in the Red house.
   2. The Swede keeps dogs as pets.
   3. The Dane drinks tea.
   4. The Green house is on the left of the White house.
   5. The owner of the Green house drinks coffee.
   6. The person who smokes Pall Mall rears birds.
   7. The owner of the Yellow house smokes Dunhill.
   8. The man living in the centre house drinks milk.
   9. The Norwegian lives in the first house.
  10. The man who smokes Blends lives next to the man who keeps cats.
  11. The man who keeps horses lives next to the man who smokes Dunhill.
  12. The man who smokes Blue Master drinks beer.
  13. The German smokes Prince.
  14. The Norwegian lives next to the Blue house.
  15. The man who smokes Blends has a neighbour who drinks water.

Who owns the fish?

http://puzzles.about.com/library/weekly/...riddle.htm

answer below in tiny text:


















The German owns the fish (I hope!)
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply


Messages In This Thread
Write a program to solve this puzzle. - by yetifoot - 06-01-2006, 07:00 AM
Write a program to solve this puzzle. - by Moneo - 06-01-2006, 07:14 AM
Write a program to solve this puzzle. - by DrV - 06-13-2006, 05:10 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)