From 1c97abe546122de35286a14e535723212976fa3b Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Wed, 7 Nov 2012 12:44:05 +0100 Subject: Prisoners Dilemma: Fix pavlov algorithm --- pavlov.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pavlov.pl b/pavlov.pl index 4ca359f..cc33a73 100644 --- a/pavlov.pl +++ b/pavlov.pl @@ -1,5 +1,5 @@ % Cooperates if and only if both players opted for the % same choice in the previous move, otherwise it defects. -pavlov([], c, _, c). +pavlov([], c, _, c):-!. pavlov([Choice|_], c, Choice, c):-!. -pavlov([_], d, _, d). +pavlov(_, d, _, d). -- cgit