From e5ed798b3af45f8f914b30f9118692901372008d Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 7 May 2014 17:22:59 -0400 Subject: [PATCH] Added play again option to horseshoes. --- horseshoes/horseshoes | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/horseshoes/horseshoes b/horseshoes/horseshoes index 9fe4c5d..7b28b1b 100755 --- a/horseshoes/horseshoes +++ b/horseshoes/horseshoes @@ -153,6 +153,8 @@ else player[2]="$(get_cpu_name)" vsCpu="true" fi +gameLoop="true" +while [ "$gameLoop" == "true" ] ; do playerCounter=1 score[1]=0 score[2]=0 @@ -218,4 +220,9 @@ else echo "${player[2]} wins with a score of ${score[2]} to ${score[1]}!" fi play -qV0 sounds/win.ogg +read -n 1 -p "Play again? " answer +if [ "${answer^}" != "Y" ] ; then +gameLoop="false" +fi +done exit 0