Skip to content

Instantly share code, notes, and snippets.

@hc0d3r
Created June 16, 2013 22:42
Show Gist options
  • Save hc0d3r/5793732 to your computer and use it in GitHub Desktop.
Save hc0d3r/5793732 to your computer and use it in GitHub Desktop.
Desafio "slot play" do Fts *-*
#!/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