Hello,
i'm taking my first class in linux and i am working on a script that will display 3 random number and display amount of jackpot, the script should act like a "slot amchine game". I have two problem one is the statement "You are a loser" is diaply even when the number is a match and should be diplayed only if not match (I can not get the "You won" to diplay) the second problem is that the Jackpot keeps display 25 and is not increasing.
Any help would be great.
_________________________________
#This is a slot machine game that uses 3 random to generate a winner or loser, it also display the jackpot amount.
#! bin/bash
rand1=$(($RANDOM % 6)) #Generate the random numbers
rand2=$(($RANDOM % 6))
rand3=$(($RANDOM % 6))
echo ""
echo ""
echo ""
echo "THE JACKPOT IS:" $((total = total + 25)) #Display the JACKPOT AMOUNT
echo ""
echo ""
echo ""
echo "YOUR NUMBERS ARE:" "[$rand1]" "[$rand2]" "[$rand3]" #Display random number
#echo "THE JACKPOT IS:" $((tota1 = total + 25))
echo ""
echo ""
echo ""
echo ""
if test [rand1 = rand2] && [rand2 = rand3] #Test for winner and loser
then
echo "YOU WON"
else
echo "YOU ARE A LOSER"
fi
echo ""
echo ""
echo""
_______________________________________