summaryrefslogtreecommitdiff
path: root/pavlov.pl
blob: cc33a73b293bac096f0d36c6638af7e8fcf7b040 (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).