diff options
Diffstat (limited to 'agent.prolog')
-rw-r--r-- | agent.prolog | 15 |
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.'), !. + |