make explicit what is alice's bet
This commit is contained in:
parent
41040f18e7
commit
cbde4fcde4
|
@ -12,13 +12,14 @@ round=0
|
||||||
# bob's hand is random
|
# bob's hand is random
|
||||||
while read -r prize bob_bet
|
while read -r prize bob_bet
|
||||||
do
|
do
|
||||||
|
alice_bet=$prize
|
||||||
printf 'Runde %s: Premie er %s, Alice satser %s, Bob satser %s.\n' \
|
printf 'Runde %s: Premie er %s, Alice satser %s, Bob satser %s.\n' \
|
||||||
"$((++round))" "$prize" "$prize" "$bob_bet"
|
"$((++round))" "$prize" "$alice_bet" "$bob_bet"
|
||||||
if ((prize > bob_bet))
|
if ((alice_bet > bob_bet))
|
||||||
then
|
then
|
||||||
((alice_sum += prize))
|
((alice_sum += prize))
|
||||||
printf 'Alice vinner %s!\n' "$prize"
|
printf 'Alice vinner %s!\n' "$prize"
|
||||||
elif ((bob_bet > prize))
|
elif ((bob_bet > alice_bet))
|
||||||
then
|
then
|
||||||
((bob_sum += prize))
|
((bob_sum += prize))
|
||||||
printf 'Bob vinner %s!\n' "$prize"
|
printf 'Bob vinner %s!\n' "$prize"
|
||||||
|
|
Loading…
Reference in New Issue