summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-07 11:09:23 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-07 11:09:23 +0100
commit6dccb06aaac40c1c8003e6023063d19c028385e9 (patch)
treefc669b47a3fd99a641f03341aa648042168d6a69
parentacb757d2d55cdd13a7bd006c2b50785d4ba8400d (diff)
downloadwbs-6dccb06aaac40c1c8003e6023063d19c028385e9.tar.gz
wbs-6dccb06aaac40c1c8003e6023063d19c028385e9.tar.bz2
wbs-6dccb06aaac40c1c8003e6023063d19c028385e9.zip
Prisoners Dilemma: Add not-yet-working pavlov
-rw-r--r--pavlov.pl5
1 files changed, 5 insertions, 0 deletions
diff --git a/pavlov.pl b/pavlov.pl
new file mode 100644
index 0000000..4ca359f
--- /dev/null
+++ b/pavlov.pl
@@ -0,0 +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([Choice|_], c, Choice, c):-!.
+pavlov([_], d, _, d).