Created
December 1, 2019 14:34
-
-
Save bucsybalazs/a83d9a67c7e0349032364fdae0e33b07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#szám kitaláló játék | |
#random szám generálása | |
(( szam = RANDOM % 10 + 1 )) | |
#a játék | |
while (( tipp != szam )); do | |
read -p "Melyik számra gondoltam 1-től 10-ig : " tipp | |
(( tipp >= 1 && tipp <= 10 )) || { echo "Hiba"; continue; } | |
if (( tipp != szam )); then | |
echo "Nem" | |
elif (( tipp = szam )); then | |
echo "Nyert ;)" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment