Added play again option to horseshoes.

This commit is contained in:
Storm Dragon 2014-05-07 17:22:59 -04:00
parent ddfe5735a6
commit e5ed798b3a

View File

@ -153,6 +153,8 @@ else
player[2]="$(get_cpu_name)" player[2]="$(get_cpu_name)"
vsCpu="true" vsCpu="true"
fi fi
gameLoop="true"
while [ "$gameLoop" == "true" ] ; do
playerCounter=1 playerCounter=1
score[1]=0 score[1]=0
score[2]=0 score[2]=0
@ -218,4 +220,9 @@ else
echo "${player[2]} wins with a score of ${score[2]} to ${score[1]}!" echo "${player[2]} wins with a score of ${score[2]} to ${score[1]}!"
fi fi
play -qV0 sounds/win.ogg play -qV0 sounds/win.ogg
read -n 1 -p "Play again? " answer
if [ "${answer^}" != "Y" ] ; then
gameLoop="false"
fi
done
exit 0 exit 0