summaryrefslogtreecommitdiff
path: root/rules/tit42tat.pl
blob: 1e6606243df984c399c7632c8bf441d951186e95 (plain)
1
2
3
4
5
6
7
% Select distraction only if opponents both last decision were to distract.
% See: http://en.wikipedia.org/wiki/Tit_for_tat#Tit_for_two_tats

% Syntax: tit42tat(+history, -choice, +state_in, -state_out)

tit42tat([d,d|_],d,_,_):-!.
tit42tat(_,c,_,_).