From 087a091275763a651613e9f168ff8bc19c31f6cb Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 6 Nov 2012 19:16:53 +0100 Subject: grudger: Rework to stop searching on first found d. --- grudger.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grudger.pl b/grudger.pl index a2792a9..5337e49 100644 --- a/grudger.pl +++ b/grudger.pl @@ -2,6 +2,6 @@ % that move defects forever (he does not forgive). % http://euler.fd.cvut.cz/predmety/game_theory/lecture_repeat.pdf -grudger([], c) :- !. -grudger([c|Tail], c) :- grudger(Tail, c),!. -grudger(_, d). +grudger([], c). +grudger([d|_], d). +grudger([c|Tail], Decision) :- grudger(Tail, Decision). -- cgit