diff options
-rw-r--r-- | tit4tat.pl | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -22,9 +22,9 @@ pay(d,d,2). pay(c,c,3). pay(d,c,4). -step(A, B, PAY_A, PAY_B) :- - pay(A, B, PAY_A), - pay(B, A, PAY_B). +pay2(A, B, PayA, PayB) :- + pay(A, B, PayA), + pay(B, A, PayB). % Use opponents last decision tit4tat_select(H,[H|_]). @@ -33,7 +33,7 @@ tit4tat_select(c,[]). tit4tat(A, Hist, PayA, PayB) :- tit4tat_select(Old, Hist), - step(A, Old, PayA, PayB). + pay2(A, Old, PayA, PayB). sum([], 0). sum([H|T], S):-sum(T, TMP), S is TMP + H. |