Skip to content

Instantly share code, notes, and snippets.

@bucsybalazs
Created December 1, 2019 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bucsybalazs/6e7d63e734bf5c759ee6dd34361aaadc to your computer and use it in GitHub Desktop.
Save bucsybalazs/6e7d63e734bf5c759ee6dd34361aaadc to your computer and use it in GitHub Desktop.
#!/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