kruthikarshankar / five_neighbors

The famous Five Neighbors puzzle solved using Prolog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

five_neighbors

There are 5 houses, each of a different color and inhabited by a man of a different nationality, with a different pet, drink, and dessert choice. From the clues given below, determine which person lives in which house, what kind of pet they own, what their favorite drink is, and what their favorite dessert is. The complete set of data for this puzzle is:

House Colors: blue, green , ivory, red , yellow

Nationalities: Englishman, Japanese, Norwegian, Spaniard, Ukrainian

Pets: dog, fox, horse, snails, zebra

Drinks: Coffee, milk, orange juice, tea, water

Desserts: ice cream, pie, cake, chocolate, mousse

The clues you have available are:

The Englishman lives in the red house.

The Spaniard owns the dog.

Coffee is drunk in the green house.

The Ukrainian drinks tea.

The green house is to the immediate right of the ivory house.

The ice cream eater owns snails.

Pie is preferred in the yellow house.

Milk is drunk in the middle house.

The Norwegian lives in the first house on the left.

The cake lover lives next to the man with the fox.

Cake is preferred in the house adjacent to the horse's place.

The chocolate lover drinks orange juice.

The Japanese man loves mousse.

The Norwegian lives next to the blue house.

The Englishman owns the fox.

About

The famous Five Neighbors puzzle solved using Prolog