Random number guesser | Bash

September 27th, 2021 10:46:47 AM

					
#!/bin/bash random_num=$((( RANDOM % 10 ) + 1 )) input=0 while [ $input -ne $random_num ] do read -p "Enter a number between 1 and 10: " input if [ $input -eq $random_num ] then echo "Congratulations, the number is $random_num." else echo "Sorry, you are not correct. Try again!" fi done;

Featured Posts