summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-06 19:16:53 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-06 19:17:57 +0100
commit087a091275763a651613e9f168ff8bc19c31f6cb (patch)
tree3e6730d91e16d78e5b7290393f0b4036353c015b
parentbb22c28250c4c20d7ba58736758a837cd8cc03d8 (diff)
downloadwbs-087a091275763a651613e9f168ff8bc19c31f6cb.tar.gz
wbs-087a091275763a651613e9f168ff8bc19c31f6cb.tar.bz2
wbs-087a091275763a651613e9f168ff8bc19c31f6cb.zip
grudger: Rework to stop searching on first found d.
-rw-r--r--grudger.pl6
1 files 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).