diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-05 14:42:26 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-05 14:42:26 +0100 |
commit | a40ea9b1904e872ca35daa168c4f7ec995895be2 (patch) | |
tree | 570470a4650018f5e01b7fb75be7f404d4a01ac8 | |
parent | 7c65af4393f262a21d86a8594b8ffdbd1b23d1aa (diff) | |
download | wbs-a40ea9b1904e872ca35daa168c4f7ec995895be2.tar.gz wbs-a40ea9b1904e872ca35daa168c4f7ec995895be2.tar.bz2 wbs-a40ea9b1904e872ca35daa168c4f7ec995895be2.zip |
tit4tat.pl: Fix variable names
-rw-r--r-- | tit4tat.pl | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -20,7 +20,7 @@ pay(d,d,2). pay(c,c,3). pay(d,c,4). -step(A, B, PAY_A, PAY_B) :- +step(A, B, PAY_A, PAY_B) :- pay(A, B, PAY_A), pay(B, A, PAY_B). @@ -33,12 +33,15 @@ tit4tat(A, Hist, PayA, PayB) :- tit4tat_select(Old, Hist), step(A, Old, PayA, PayB). -loop(end, [_]). +loop(end, _). loop(End, Hist):- End\=end, - write('Type c,d or end to end: '), read(Word), - tit4tat(Word, Hist, PAY_A, PAY_B), + write('Type c,d or end to end: '), read(Choice), + + tit4tat(Choice, Hist, PAY_A, PAY_B), + write('A Pay: '),write(PAY_A),nl, write('B Pay: '),write(PAY_B),nl, - loop(Word, [Word|Hist]). + + loop(Choice, [Choice|Hist]). start:-loop(noend, []). |