26 lines
339 B
Bash
26 lines
339 B
Bash
|
#!/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 "$@"
|
||
|
|