countdown-bash/countdown.sh
2024-05-19 18:10:39 +12:00

26 lines
339 B
Bash
Executable File

#!/bin/bash
set -eu
randn() {
# 1-ARG inclusive
seq 1 $1 | shuf | head -n1
}
big() {
echo '10 25 50 75 100' | tr ' ' $'\n' | shuf | head -n1
}
small() {
seq 1 10 | shuf | head -n1
}
main() {
printf "Target: %03d\n" $(randn 999)
printf "Numbers: %d %d %d %d %d %d\n" \
`big` `big` `small` `small` `small` `small`
}
main "$@"