diff --git a/sh/tests/solutions/array-selector.sh b/sh/tests/solutions/array-selector.sh index 233ec594c..0bedd67ba 100755 --- a/sh/tests/solutions/array-selector.sh +++ b/sh/tests/solutions/array-selector.sh @@ -6,9 +6,9 @@ IFS=' COLORS=('red' 'blue' 'green' 'white' 'black') if [[ ! $1 =~ ^[0-9]+$ ]] || [[ $1 -le 0 ]] || [[ $1 -gt ${#COLORS[@]} ]]; then echo 'Error' - exit 1 +else + POS=$(($1 - 1)) + echo ${COLORS[$POS]} fi -POS=$(($1 - 1)) -echo ${COLORS[$POS]}