Shouldn't allow blank names any more.
This commit is contained in:
parent
519905fc62
commit
a368dcda17
@ -138,12 +138,16 @@ fi
|
|||||||
fi
|
fi
|
||||||
echo "Welcome to horseshoes."
|
echo "Welcome to horseshoes."
|
||||||
if [ "$1" != "c" ] ; then
|
if [ "$1" != "c" ] ; then
|
||||||
|
while [ -z "${player[1]}" ] ; do
|
||||||
read -p "Player 1, please enter your name: " player[1]
|
read -p "Player 1, please enter your name: " player[1]
|
||||||
|
done
|
||||||
else
|
else
|
||||||
player[1]="$(get_cpu_name)"
|
player[1]="$(get_cpu_name)"
|
||||||
fi
|
fi
|
||||||
if [[ "$1" =~ 2 ]] ; then
|
if [[ "$1" =~ 2 ]] ; then
|
||||||
|
while [ -z "${player[2]}" ] ; do
|
||||||
read -p "Player 2, please enter your name: " player[2]
|
read -p "Player 2, please enter your name: " player[2]
|
||||||
|
done
|
||||||
vsCpu="false"
|
vsCpu="false"
|
||||||
else
|
else
|
||||||
player[2]="$(get_cpu_name)"
|
player[2]="$(get_cpu_name)"
|
||||||
|
Loading…
Reference in New Issue
Block a user