zebra.pl : Based on the classic zebra puzzle
Solves the classic "zebra puzzle" a.k.a. "Einstein's Riddle" (cf. http://en.wikipedia.org/wiki/Zebra_Puzzle):
1. The Englishman lives in the red house.
2. The Spaniard owns the dog.
3. Coffee is drunk in the green house.
4. The Ukrainian drinks tea.
5. The green house is immediately to the right of the ivory house.
6. The Porsche driver owns snails.
7. The Masserati is driven by the man who lives in the yellow house.
8. Milk is drunk in the middle house.
9. The Norwegian lives in the first house on the left.
10. The man who drives a Saab lives in the house next to the man with the fox.
11. The Masserati is driven by the man in the house next to the house where the horse is kept.
12. The Honda driver drinks orange juice.
13. The Japanese drives a Jaguar.
14. The Norwegian lives next to the blue house.

How to use:
zebra(S) returns the solution in a 5x5-matrix, one row for each person:
S = [ [HouseColor1, Nationality1, Car1, Drink1, Pet1], [ ... ], ... ]

Program: Change the code, then submit!

Console: Enter query or select example from below, then submit and wait for answer!

 Select example query: (Clear query) zebra(S).

WebCHR help - CHR Website - (c) Copyrights Martin Kaeser Uni Ulm 2007