summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--prisoners_dilemma.pl7
1 files changed, 3 insertions, 4 deletions
diff --git a/prisoners_dilemma.pl b/prisoners_dilemma.pl
index f4f5d74..535db0d 100644
--- a/prisoners_dilemma.pl
+++ b/prisoners_dilemma.pl
@@ -34,10 +34,9 @@ do(Choice, Module, ModuleState, Hist, PayedA, PayedB) :-
decide(Module, Hist, ModuleDecision, ModuleState, NewModuleState),
pay2(Choice, ModuleDecision, PayA, PayB),
- write('A Pay: '), write(Choice), write(': '), write(PayA), write('\t'),
- write('B Pay: '), write(ModuleDecision), write(': '), write(PayB), write('\t'),
- write('A: '), sum([PayA|PayedA], SumA), write(SumA), write('\t'),
- write('B: '), sum([PayB|PayedB], SumB), write(SumB), nl,
+ sum([PayA|PayedA], SumA), sum([PayB|PayedB], SumB),
+ format('A [~w]: ~w\tB [~w]: ~w\tA Total: ~w\tB Total: ~w\n',
+ [Choice, PayA, ModuleDecision, PayB, SumA, SumB]),
loop(Module, NewModuleState, [Choice|Hist], [PayA|PayedA], [PayB|PayedB]).