#!/bin/bash MIN=1 MAX=100 R_N=$((RANDOM % (MAX - MIN + 1) + MIN)) guess=0 while [ $guess -ne $R_N ]; do echo "Guess the secret number (between $MIN and $MAX):" read guess if [ $guess -lt $R_N ]; then echo "Too low!" elif [ $guess -gt $R_N ]; then echo "Too high!" else echo "Congratulations! You guessed the secret number: $R_N" fi done