From c33ee86c272aaac287970a588b8c6dbf6aa52211 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Thu, 20 Mar 2014 21:03:32 +1100 Subject: Basic movement added --- agent.prolog | 14 ++++++++++++++ main.prolog | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 agent.prolog create mode 100644 main.prolog diff --git a/agent.prolog b/agent.prolog new file mode 100644 index 0000000..338b3f2 --- /dev/null +++ b/agent.prolog @@ -0,0 +1,14 @@ + +:- module(agent, [look/0, move/1]). + + +look :- + write('looking\n'). + + +move(D) :- + here(L), + connects(L,N,D), + retract(here(L)), + asserta(here(N)), !. + diff --git a/main.prolog b/main.prolog new file mode 100644 index 0000000..5204ef7 --- /dev/null +++ b/main.prolog @@ -0,0 +1,11 @@ + + +:- consult('map.prolog'). +:- consult('agent.prolog'). +:- consult('read.prolog'). + + +init :- + retractall(here(X)), + asserta(here(a)), !. + -- cgit