summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-03-20 21:03:32 +1100
committerJed Barber <jjbarber@y7mail.com>2014-03-20 21:03:32 +1100
commitc33ee86c272aaac287970a588b8c6dbf6aa52211 (patch)
treef4925c254a43bf4e3750996b2cf8ac06287af281
parent924f3e7e093f62930270a5670c7b6d9d09a19924 (diff)
Basic movement added
-rw-r--r--agent.prolog14
-rw-r--r--main.prolog11
2 files changed, 25 insertions, 0 deletions
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)), !.
+