summaryrefslogtreecommitdiff
path: root/rules/hard_tit4tat.pl
diff options
context:
space:
mode:
Diffstat (limited to 'rules/hard_tit4tat.pl')
-rw-r--r--rules/hard_tit4tat.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/rules/hard_tit4tat.pl b/rules/hard_tit4tat.pl
new file mode 100644
index 0000000..8efc124
--- /dev/null
+++ b/rules/hard_tit4tat.pl
@@ -0,0 +1,6 @@
+% Hard Tit for Tat:
+% Cooperates unless the opponent has defected
+% at least once in the last two rounds.
+
+hard_tit4tat([A,B|_],d,_,_):-(A=d;B=d),!.
+hard_tit4tat(_,c,_,_).