diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-03-21 03:01:42 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-03-21 03:01:42 +1100 |
commit | 410fc38f935b552a58af2e716d2fe814eee432c9 (patch) | |
tree | 606416b2be1b88eb3861c9ee4bb48ec081250741 /item.prolog | |
parent | c33ee86c272aaac287970a588b8c6dbf6aa52211 (diff) |
Basic items and look command
Diffstat (limited to 'item.prolog')
-rw-r--r-- | item.prolog | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/item.prolog b/item.prolog new file mode 100644 index 0000000..11e469c --- /dev/null +++ b/item.prolog @@ -0,0 +1,22 @@ + +:- module(item, [itemAt/2, writeItemsAt/1, canTake/1, description/2]). + + +itemAt(ladder,a). + + +writeItemsAt(L) :- + itemAt(X,L), + description(X,D), + write(D), + fail. +writeItemsAt(_) :- true. + + +canTake(gold). +canTake(deadWumpus). + + +description(ladder, 'There is a rope ladder hanging from the ceiling here.\n'). +description(gold, 'You see a glitter along the sandy floor of the cave.\n'). + |