summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-06 17:10:14 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-06 17:10:14 +0100
commitfa41b7300e3d16ca22527a802feba3bdaddd149e (patch)
tree8178fb3b4f4b5f96e5384565c26d100dba9e2256
parent5a3337ec17d6bb39b0d43793c454ab199e4d9b0e (diff)
downloadwbs-fa41b7300e3d16ca22527a802feba3bdaddd149e.tar.gz
wbs-fa41b7300e3d16ca22527a802feba3bdaddd149e.tar.bz2
wbs-fa41b7300e3d16ca22527a802feba3bdaddd149e.zip
Prisoners Dilemma: Add mistrust_tit4tat algorithm
-rw-r--r--mistrust_tit4tat.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/mistrust_tit4tat.pl b/mistrust_tit4tat.pl
new file mode 100644
index 0000000..ebea1cb
--- /dev/null
+++ b/mistrust_tit4tat.pl
@@ -0,0 +1,6 @@
+% Syntax: MODULE(UserDecisionHistry [in], ModuleDecision [out])
+
+% Use opponents last decision
+mistrust_tit4tat([Last|_],Last).
+% Fallback to defect if history is empty.
+mistrust_tit4tat([],d).