Magic 8-ball: Difference between revisions

→‎{{header|UNIX Shell}}: not using a hard-coded array length
(→‎{{header|UNIX Shell}}: not using a hard-coded array length)
Line 2,784:
read -p 'Enter Question: '
[[ "$REPLY" == quit ]]
do printf "Response: %s\n\n" "${RESPONSES[RANDOM % 20${#RESPONSES[@]}]}"
done
</syntaxhighlight>
1,934

edits