summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-06 19:01:42 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-06 19:09:09 +0100
commitbb22c28250c4c20d7ba58736758a837cd8cc03d8 (patch)
treef960491b91cf2587bfaaa631a4deeb360eb423fb
parentcf338b50e67f487b848a14f1dbad1bb79246cf59 (diff)
downloadwbs-bb22c28250c4c20d7ba58736758a837cd8cc03d8.tar.gz
wbs-bb22c28250c4c20d7ba58736758a837cd8cc03d8.tar.bz2
wbs-bb22c28250c4c20d7ba58736758a837cd8cc03d8.zip
Prisoners Dilemma: Add grudger algorithm
-rw-r--r--grudger.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/grudger.pl b/grudger.pl
new file mode 100644
index 0000000..a2792a9
--- /dev/null
+++ b/grudger.pl
@@ -0,0 +1,7 @@
+% Cooperates until the second has defected, after
+% that move defects forever (he does not forgive).
+% http://euler.fd.cvut.cz/predmety/game_theory/lecture_repeat.pdf
+
+grudger([], c) :- !.
+grudger([c|Tail], c) :- grudger(Tail, c),!.
+grudger(_, d).