Skip to content

Instantly share code, notes, and snippets.

@basicxman
Created May 18, 2011 05:49
Show Gist options
  • Select an option

  • Save basicxman/978048 to your computer and use it in GitHub Desktop.

Select an option

Save basicxman/978048 to your computer and use it in GitHub Desktop.
First Prolog assignment in Seven Languages in Seven Weeks
book_author('JavaScript The Good Parts', 'Douglas Crockford').
book_author('Seven Languages in Seven Weeks', 'Bruce A. Tate').
book_author('Rework', 'Jason Fried').
book_author('The Little Schemer', 'Daniel P. Friedman').
book_author('Code Complete', 'Steve McConnell').
book_author('Software Estimation', 'Steve McConnell').
book_author('Software Project Survival Guide', 'Steve McConnell').
% Note: These genres are totally inaccurate, but I'm lazy.
book_genre('JavaScript The Good Parts', 'Web Development').
book_genre('Seven Languages in Seven Weeks', 'Programming').
book_genre('Rework', 'Work Habits').
book_genre('The Little Schemer', 'Programming').
book_genre('Code Complete', 'Programming').
book_genre('Software Estimation', 'Project Management').
book_genre('Software Project Survival Guide', 'Project Management').
book_by_author(X, Z) :- book_author(X, Z).
book_by_genre(X, Z) :- book_genre(X, Z).
book_author_genre(X, Y, Z) :- book_author(X, Y), book_genre(X, Z).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment