Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Hash-join/Prolog/hash-join.pro
Normal file
20
Task/Hash-join/Prolog/hash-join.pro
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
% Name/Age
|
||||
person_age('Jonah', 27).
|
||||
person_age('Alan', 18).
|
||||
person_age('Glory', 28).
|
||||
person_age('Popeye', 18).
|
||||
person_age('Alan', 28).
|
||||
|
||||
% Character/Nemesis
|
||||
character_nemisis('Jonah', 'Whales').
|
||||
character_nemisis('Jonah', 'Spiders').
|
||||
character_nemisis('Alan', 'Ghosts').
|
||||
character_nemisis('Alan', 'Zombies').
|
||||
character_nemisis('Glory', 'Buffy').
|
||||
|
||||
join_and_print :-
|
||||
format('Age\tName\tCharacter\tNemisis\n\n'),
|
||||
forall(
|
||||
(person_age(Person, Age), character_nemisis(Person, Nemesis)),
|
||||
format('~w\t~w\t~w\t\t~w\n', [Age, Person, Person, Nemesis])
|
||||
).
|
||||
Loading…
Add table
Add a link
Reference in a new issue