Created
June 16, 2013 22:42
-
-
Save hc0d3r/5793732 to your computer and use it in GitHub Desktop.
Desafio "slot play" do Fts *-*
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/sh | |
fichas=10 | |
while [ $fichas != 0 ] | |
do | |
echo -e "\nVoce tem $fichas fichas:\nPressione Enter para jogar " | |
read | |
num=($(($RANDOM % 8)) $(($RANDOM % 8)) $(($RANDOM % 8))) | |
echo ${num[0]} ${num[1]} ${num[2]} | |
if [ ${num[0]} == ${num[1]} ] && [ ${num[2]} == ${num[1]} ] | |
then | |
echo -e "\nVoce ganhou !!!" | |
fichas=$(($fichas+2)) | |
else | |
(( fichas-- )) | |
fi | |
done | |
echo -e "\nGame Over !!!\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment