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 /agent.prolog | |
parent | c33ee86c272aaac287970a588b8c6dbf6aa52211 (diff) |
Basic items and look command
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.'), !. + |