Add some randomness to spin.

This commit is contained in:
Storm Dragon 2020-07-31 12:58:04 -04:00
parent 651a7ae6c6
commit ae2088b301

View File

@ -8,13 +8,14 @@ message="${*}"
spin="${message##*[[:space:]]}"
message="${message} $spin $spin $spin "
spinCount=$((RANDOM % 7 + 7))
if [[ "$spin" =~ [aeiou].$ ]]; then
for i in $(seq 10) ; do
for i in $(seq $spinCount) ; do
spin+="${spin: -1}${spin: -1}"
message+="$spin "
done
else
for i in $(seq 10) ; do
for i in $(seq $spinCount) ; do
spin+="${spin: -2}"
message+="$spin "
done