summaryrefslogtreecommitdiff
path: root/tit4tat.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tit4tat.pl')
-rw-r--r--tit4tat.pl11
1 files changed, 3 insertions, 8 deletions
diff --git a/tit4tat.pl b/tit4tat.pl
index e03fd5d..6362ecc 100644
--- a/tit4tat.pl
+++ b/tit4tat.pl
@@ -1,9 +1,4 @@
-%
% Use opponents last decision
-tit4tat_select(H,[H|_]).
-% Fallback to coorporate at beginning
-tit4tat_select(c,[]).
-
-tit4tat(A, Hist, PayA, PayB) :-
- tit4tat_select(Old, Hist),
- pay2(A, Old, PayA, PayB).
+tit4tat([Last|_],Last).
+% Fallback to coorporate if history is empty.
+tit4tat([],c).