Skip to content

Instantly share code, notes, and snippets.

@mark-d-holmberg
Created September 10, 2011 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mark-d-holmberg/1207883 to your computer and use it in GitHub Desktop.
Save mark-d-holmberg/1207883 to your computer and use it in GitHub Desktop.
Asserting in Prolog
Mark Holmberg, Dixie State College of Utah
CS 3520, Programming Languages
9 Sept. 2011
Some help with the adventure game
% Lets assert some things
assert(bag(key)), assert(bag(candle)), assert(bag(sword)), assert(bag(bow)).
% do we have a candle?
bag(candle).
% has the candle left our bag?
\+ bag(candle).
% do we have booze?
bag(beer).
% Best of luck!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment