summaryrefslogtreecommitdiff
path: root/rules/hard_tit4tat.pl
blob: 6ba56e6bc359deedbe0cf46364278f2c49d7d65e (plain)
1
2
3
4
5
6
7
8
% Hard Tit for Tat:
% Cooperates unless the opponent has defected
% at least once in the last two rounds.

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

hard_tit4tat([A,B|_],d,_,_):-(A=d;B=d),!.
hard_tit4tat(_,c,_,_).