summaryrefslogtreecommitdiff
path: root/pavlov.pl
blob: 4ca359f5d8db43c0f715f97a578fd9668bc15253 (plain)
1
2
3
4
5
% Cooperates if and only if both players opted for the
% same choice in the previous move, otherwise it defects.
pavlov([], c, _, c).
pavlov([Choice|_], c, Choice, c):-!.
pavlov([_], d, _, d).