make explicit what is alice's bet

This commit is contained in:
OMGOMG 2022-04-06 16:40:17 +02:00
parent 41040f18e7
commit cbde4fcde4
1 changed files with 4 additions and 3 deletions

View File

@ -12,13 +12,14 @@ round=0
# bob's hand is random
while read -r prize bob_bet
do
alice_bet=$prize
printf 'Runde %s: Premie er %s, Alice satser %s, Bob satser %s.\n' \
"$((++round))" "$prize" "$prize" "$bob_bet"
if ((prize > bob_bet))
"$((++round))" "$prize" "$alice_bet" "$bob_bet"
if ((alice_bet > bob_bet))
then
((alice_sum += prize))
printf 'Alice vinner %s!\n' "$prize"
elif ((bob_bet > prize))
elif ((bob_bet > alice_bet))
then
((bob_sum += prize))
printf 'Bob vinner %s!\n' "$prize"