countdown-bash/countdown.sh

26 lines
339 B
Bash
Raw Normal View History

2024-05-19 06:10:39 +00:00
#!/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 "$@"