From 410fc38f935b552a58af2e716d2fe814eee432c9 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Fri, 21 Mar 2014 03:01:42 +1100 Subject: Basic items and look command --- item.prolog | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 item.prolog (limited to 'item.prolog') 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'). + -- cgit