I'm making a random number guessing game, but I want it to last longer than one guess, when u guess wrong it adds one to ded. and repeats from a certain point (I'll add STARTHERE where it needs to start again). I know theres a command in Windows with:
:hello script goto hello.
But this doesn't work in Ubuntu Bash. Here's my script.
number=$(( (RANDOM % 100) + 1 ))
echo $number # Just for testing purposes
# STARTHERE (This is not in the script)
read guess
if [ $guess = $number ];
then
echo "Cool! You won!"
elif [ $guess > $number ]
then
echo "not needed"
elif [ $guess < $number ]
then
echo "not needed rn"
fi
( & = 1 )
elif [ $guess =/= $number ]
then
ded=&(( (+ 1) ))
fi