________________________________________________________________________

This file is part of Logtalk <http://logtalk.org/>  

Logtalk is free software. You can redistribute it and/or modify it under
the terms of the FSF GNU General Public License 3  (plus some additional
terms per section 7).        Consult the `LICENSE.txt` file for details.
________________________________________________________________________


% start by loading the example and the required library files:

| ?- logtalk_load(puzzles(loader)).
...


% Harry Potter's room of potions logical puzzle:

| ?- potions::potions(P1, P2, P3, P4, P5, P6, P7).

P1 = poison
P2 = wine
P3 = forward
P4 = poison
P5 = poison
P6 = wine
P7 = backwards

yes


% Horse show logical puzzle:

| ?- horses::(horses(S), print(S)).
1 place: april riding doc, the chestnut gelding
2 place: sue riding danny, the bay gelding
3 place: doc riding gopher, the gray gelding
4 place: danny riding april, the white mare
5 place: gopher riding sue, the black mare

S = [h(doc,gelding,chestnut,april,1),h(danny,gelding,bay,sue,2),h(gopher,gelding,gray,doc,3),h(april,mare,white,danny,4),h(sue,mare,black,gopher,5)] ? 

yes


% Who Stole the Jam?

| ?- jam_thief::thief(Thief).

Thief = hare

yes

| ?- jam_thief::thief(Thief, Why).

Thief = hare
Why = [trusty(dormouse),liar(hare),trusty(hatter)] ? 

yes


% Houses logical puzzle:

| ?- houses::(houses(Solution), print(Solution)).
h(norwegian,fox,kool,water,yellow)
h(ukrainian,horse,chesterfield,tea,blue)
h(english,snake,winston,milk,red)
h(spanish,dog,lucky,juice,white)
h(japonese,zebra,kent,coffee,green)
Solution = [h(norwegian, fox, kool, water, yellow), h(ukrainian, horse, chesterfield, tea, blue), h(english, snake, winston, milk, red), h(spanish, dog, lucky, juice, white), h(japonese, zebra, kent, coffee, green)] ;
h(norwegian,fox,kool,water,yellow)
h(ukrainian,horse,chesterfield,tea,blue)
h(english,snake,winston,milk,red)
h(japonese,zebra,kent,coffee,green)
h(spanish,dog,lucky,juice,white)
Solution = [h(norwegian, fox, kool, water, yellow), h(ukrainian, horse, chesterfield, tea, blue), h(english, snake, winston, milk, red), h(japonese, zebra, kent, coffee, green), h(spanish, dog, lucky, juice, white)] ;
no

| ?- zebra_owner(Owner).
Owner = japonese ;
Owner = japonese ;
no

| ?- water_drinker(Drinker).
Drinker = norwegian ;
Drinker = norwegian ;
no


% Passing a note logical puzzle

| ?- note::(students(S), print(S)).
s(mary,english,red,1)
s(paul,math,yellow,2)
s(josephine,science,green,3)
s(derrick,french,blue,4)
s(alexis,reading,black,5)

S = [s(mary,english,red,1),s(paul,math,yellow,2),s(josephine,science,green,3),s(derrick,french,blue,4),s(alexis,reading,black,5)] ? 

yes


% Mort's Letter from Camp Swampy logical puzzle

| ?- camp_swampy::(beds(S), print(S)).
tim thomas, from maine, sleeps on bed number 1
sam franklin, from north_carolina, sleeps on bed number 2
mac miller, from virginia, sleeps on bed number 3
fred james, from florida, sleeps on bed number 4
john smith, from arkansas, sleeps on bed number 5

S = [b(tim,thomas,maine,1),b(sam,franklin,north_carolina,2),b(mac,miller,virginia,3),b(fred,james,florida,4),b(john,smith,arkansas,5)] ? 

yes
