Someone sent me this puzzle and as I am trying to learn scala thought it would be a good opportunity to try to solve with scala. During making this I tried to use many best practices and different scala features.
The objective is to figure out who drinks the 'water' and who owns the 'zebra'.
- There are five houses each of a different color and inhabited by men of different nationalities, with different pets, drinks, and cigarettes.
- The Englishmen lives in the red house.
- The Spaniard owns the dog.
- Coffee is drunk in the green house.
- The Ukranian drinks tea.
- The green house is immediately to the right (your right) of the ivory house.
- The Old Gold smoker owns snails.
- Kools are smoked in the yellow house.
- Milk is drunk in the middle house.
- The Norwegian lives in the first house on the left.
- The man who smokes Chesterfields lives in the house next to the man with the fox.
- Kools are smoked in the house next to the house where the horse is kept.
- The Lucky Strike smoker drinks orange juice.
- The Japanese man smokes Parliaments.
- The Norwegian lives next to the blue house.
So...with the info listed above, who drinks water, and who owns the zebra??