#!bin/bash echo > quiz3.txt echo "Welcome! You will start the Blackjack." echo "Do you pick a card? [y/n]?" read a c=0 r="score:" while [ $c -le 21 ]; do if [ "$a" = "y" ]; then a= b=`jot -r 1 1 10` c=`expr $c + $b` d=" $b," r="$r$d" echo "This card is $b, Now sum of your cards is $c." if [ $c -le 21 ]; then echo "Do you pick a card? [y/n]?" read a fi else echo "Sum of your cards is $c. You win!" echo "Exit out of the Blackjack. Thank you." sl echo "$r" >> quiz3.txt echo "total: $c" >> quiz3.txt break fi done if [ $c -gt 21 ]; then r="$r$d" echo "Sum of your cards exceeded 21. You lost!" echo "$r" >> quiz3.txt echo "total: $c" >> quiz3.txt fi