Skip to content

Conversation

@D3usXMachina
Copy link

Add colours of houses to body of zebra_owner predicate.

The puzzle can be solved without knowing the colour of the last house, but a priori we wouldn't know that.

A minimal example that yields the entire solution would be:

solvesPuzzle(Street) :- 
    Street = [_,_,_],
    member(house(green,_,_), Street),
    member(house(red,english,_), Street),
    member(house(_,spanish,jaguar), Street),
    sublist([house(_,_,snail),house(_,japanese,_)], Street),
    sublist([house(_,_,snail),house(blue,_,_)], Street),
    member(house(_,_,zebra), Street).

which yields:

Street = [house(red, english, snail), house(blue, japanese, zebra), house(green, spanish, jaguar)] .

Add colors of houses to body of zebra_owner predicate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant