summaryrefslogtreecommitdiff
path: root/agent.prolog
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-03-21 03:01:42 +1100
committerJed Barber <jjbarber@y7mail.com>2014-03-21 03:01:42 +1100
commit410fc38f935b552a58af2e716d2fe814eee432c9 (patch)
tree606416b2be1b88eb3861c9ee4bb48ec081250741 /agent.prolog
parentc33ee86c272aaac287970a588b8c6dbf6aa52211 (diff)
Basic items and look command
Diffstat (limited to 'agent.prolog')
-rw-r--r--agent.prolog15
1 files changed, 13 insertions, 2 deletions
diff --git a/agent.prolog b/agent.prolog
index 338b3f2..994b77d 100644
--- a/agent.prolog
+++ b/agent.prolog
@@ -1,9 +1,11 @@
-:- module(agent, [look/0, move/1]).
+:- module(agent, [look/0, move/1, take/1]).
look :-
- write('looking\n').
+ here(L),
+ writeItemsAt(L),
+ writeExits(L).
move(D) :-
@@ -12,3 +14,12 @@ move(D) :-
retract(here(L)),
asserta(here(N)), !.
+
+take(T) :-
+ here(L),
+ itemAt(T,L),
+ canTake(T),
+ retract(itemAt(T,L)),
+ asserta(holding(T)),
+ write('Taken.'), !.
+