summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-07 12:44:05 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-07 12:44:05 +0100
commit1c97abe546122de35286a14e535723212976fa3b (patch)
treea63b5057de0e75a32e7f9ac8b41ab32f979a19dd
parent6dccb06aaac40c1c8003e6023063d19c028385e9 (diff)
downloadwbs-1c97abe546122de35286a14e535723212976fa3b.tar.gz
wbs-1c97abe546122de35286a14e535723212976fa3b.tar.bz2
wbs-1c97abe546122de35286a14e535723212976fa3b.zip
Prisoners Dilemma: Fix pavlov algorithm
-rw-r--r--pavlov.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/pavlov.pl b/pavlov.pl
index 4ca359f..cc33a73 100644
--- a/pavlov.pl
+++ b/pavlov.pl
@@ -1,5 +1,5 @@
% Cooperates if and only if both players opted for the
% same choice in the previous move, otherwise it defects.
-pavlov([], c, _, c).
+pavlov([], c, _, c):-!.
pavlov([Choice|_], c, Choice, c):-!.
-pavlov([_], d, _, d).
+pavlov(_, d, _, d).